summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/elf.h6
-rw-r--r--include/errno.h2
-rw-r--r--include/error.h4
-rw-r--r--include/fcntl.h3
-rw-r--r--include/features.h122
-rw-r--r--include/libc-symbols.h7
-rw-r--r--include/libintl.h14
-rw-r--r--include/link.h12
-rw-r--r--include/netinet/in.h150
-rw-r--r--include/printf.h2
-rw-r--r--include/rpc/xdr.h31
-rw-r--r--include/sched.h25
-rw-r--r--include/signal.h4
-rw-r--r--include/stdlib.h13
-rw-r--r--include/sys/cdefs.h2
-rw-r--r--include/sys/epoll.h107
-rw-r--r--include/sys/mman.h2
-rw-r--r--include/sys/prctl.h32
-rw-r--r--include/sys/sendfile.h10
-rw-r--r--include/sys/syscall.h1
-rw-r--r--include/sys/types.h3
-rw-r--r--include/time.h10
-rw-r--r--include/unistd.h58
-rw-r--r--libc/sysdeps/linux/common/epoll.c37
-rw-r--r--libc/sysdeps/linux/common/prctl.c9
-rw-r--r--libm/Makefile.in8
-rw-r--r--libnsl/Makefile.in2
-rw-r--r--libnsl/nsl.c18
-rw-r--r--libpthread/linuxthreads.old/Makefile.in7
-rw-r--r--libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h24
-rw-r--r--libpthread/linuxthreads/Makefile4
-rw-r--r--libpthread/linuxthreads/Makefile.in11
-rw-r--r--libresolv/Makefile.in2
-rw-r--r--libresolv/resolv.c18
-rw-r--r--librt/Makefile.in2
-rw-r--r--librt/kernel-posix-cpu-timers.h18
-rw-r--r--librt/mq_getsetattr.c9
-rw-r--r--librt/mq_receive.c10
-rw-r--r--librt/mq_send.c10
-rw-r--r--libutil/Makefile.in18
-rw-r--r--libutil/forkpty.c6
-rw-r--r--libutil/login_tty.c6
-rw-r--r--libutil/openpty.c13
43 files changed, 447 insertions, 405 deletions
diff --git a/include/elf.h b/include/elf.h
index e1dae0962..44fcb2370 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -2591,6 +2591,12 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_390_NUM 61
+/* CRIS flags. */
+#define EF_CRIS_VARIANT_MASK 0x0000000e
+#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
+#define EF_CRIS_VARIANT_V32 0x00000002
+#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
+
/* CRIS relocations. */
#define R_CRIS_NONE 0
#define R_CRIS_8 1
diff --git a/include/errno.h b/include/errno.h
index 527326b17..91d78df95 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -82,7 +82,7 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__));
that printing `error_t' values in the debugger shows the names. We
might need this definition sometimes even if this file was included
before. */
-#if defined __USE_GNU || defined __need_error_t
+#if ( defined __USE_GNU || defined __need_error_t ) && !defined __ASSEMBLER__
# ifndef __error_t_defined
typedef int error_t;
# define __error_t_defined 1
diff --git a/include/error.h b/include/error.h
index 3638bc6e9..ef97ff2c7 100644
--- a/include/error.h
+++ b/include/error.h
@@ -53,12 +53,12 @@ extern void error_at_line (int __status, int __errnum, const char *__fname,
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
-extern void (*error_print_progname) (void);
+/* extern void (*error_print_progname) (void); */
#else
void error ();
void error_at_line ();
-extern void (*error_print_progname) ();
+/* extern void (*error_print_progname) (); */
#endif
/* This variable is incremented each time `error' is called. */
diff --git a/include/fcntl.h b/include/fcntl.h
index b7b62ae33..a43890215 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -79,6 +79,9 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
# define fcntl fcntl64
# endif
#endif
+#ifdef __USE_LARGEFILE64
+extern int fcntl64 (int __fd, int __cmd, ...);
+#endif
/* Open FILE and return a new file descriptor for it, or -1 on error.
OFLAG determines the type of access used. If O_CREAT is on OFLAG,
diff --git a/include/features.h b/include/features.h
index ec807d523..c690e7ec2 100644
--- a/include/features.h
+++ b/include/features.h
@@ -19,6 +19,23 @@
#ifndef _FEATURES_H
#define _FEATURES_H 1
+/* This macro indicates that the installed library is uClibc. Use
+ * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
+ * specific releases. */
+#define __UCLIBC__ 1
+
+/* Load up the current set of uClibc supported features along
+ * with the current uClibc major and minor version numbers.
+ * For uClibc release 0.9.26, these numbers would be:
+ * #define __UCLIBC_MAJOR__ 0
+ * #define __UCLIBC_MINOR__ 9
+ * #define __UCLIBC_SUBLEVEL__ 26
+ */
+#define __need_uClibc_config_h
+#include <bits/uClibc_config.h>
+#undef __need_uClibc_config_h
+#include <bits/uClibc_arch_features.h>
+
/* For uClibc, always optimize for size -- this should disable
* a lot of expensive inlining... */
#define __OPTIMIZE_SIZE__ 1
@@ -42,6 +59,7 @@
_FILE_OFFSET_BITS=N Select default filesystem interface.
_BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
_SVID_SOURCE ISO C, POSIX, and SVID things.
+ _ATFILE_SOURCE Additional *at interfaces.
_GNU_SOURCE All of the above, plus GNU extensions.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
@@ -73,6 +91,7 @@
__USE_BSD Define 4.3BSD things.
__USE_SVID Define SVID things.
__USE_MISC Define things common to BSD and System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
__USE_GNU Define GNU extensions.
__USE_REENTRANT Define reentrant/thread-safe *_r functions.
__USE_FORTIFY_LEVEL Additional security measures used, according to level.
@@ -106,6 +125,7 @@
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
+#undef __USE_ATFILE
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __USE_FORTIFY_LEVEL
@@ -162,6 +182,8 @@
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
# define _SVID_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
#endif
/* If nothing (other than _GNU_SOURCE) is defined,
@@ -258,6 +280,10 @@
# define __USE_SVID 1
#endif
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
#ifdef _GNU_SOURCE
# define __USE_GNU 1
#endif
@@ -266,37 +292,23 @@
# define __USE_REENTRANT 1
#endif
-#if _FORTIFY_SOURCE > 0 && __GNUC_PREREQ (4, 1) && defined(__OPTIMIZE__)
-# if _FORTIFY_SOURCE == 1
-# define __USE_FORTIFY_LEVEL 1
-# elif _FORTIFY_SOURCE > 1
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
+ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+# if _FORTIFY_SOURCE > 1
# define __USE_FORTIFY_LEVEL 2
+# else
+# define __USE_FORTIFY_LEVEL 1
# endif
+#else
+# define __USE_FORTIFY_LEVEL 0
#endif
/* We do support the IEC 559 math functionality, real and complex. */
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
-/* This macro indicates that the installed library is uClibc. Use
- * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
- * specific releases. */
-#define __UCLIBC__ 1
-
-/* Load up the current set of uClibc supported features along
- * with the current uClibc major and minor version numbers.
- * For uClibc release 0.9.26, these numbers would be:
- * #define __UCLIBC_MAJOR__ 0
- * #define __UCLIBC_MINOR__ 9
- * #define __UCLIBC_SUBLEVEL__ 26
- */
-#define __need_uClibc_config_h
-#include <bits/uClibc_config.h>
-#undef __need_uClibc_config_h
-#include <bits/uClibc_arch_features.h>
-
#ifdef __UCLIBC_HAS_WCHAR__
-/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.0. */
+/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
# define __STDC_ISO_10646__ 200009L
#endif
@@ -308,14 +320,32 @@
* are not really intended to check for the presence of a particular library,
* but rather are used to define an _interface_. */
#if !defined __FORCE_NOGLIBC && (!defined _LIBC || defined __FORCE_GLIBC)
-# define __GNU_LIBRARY__ 6
-# define __GLIBC__ 2
-# define __GLIBC_MINOR__ 2
+/* This macro indicates that the installed library is the GNU C Library.
+ For historic reasons the value now is 6 and this will stay from now
+ on. The use of this variable is deprecated. */
+# undef __GNU_LIBRARY__
+# define __GNU_LIBRARY__ 6
+
+/* Major and minor version number of the GNU C library package. Use
+ these macros to test for features in specific releases. */
+/* Don't do it, if you want to keep uClibc happy. */
+# define __GLIBC__ 2
+# define __GLIBC_MINOR__ 2
#endif
#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+#ifndef __UCLIBC__
+/* Decide whether a compiler supports the long long datatypes. */
+#if defined __GNUC__ \
+ || (defined __PGI && defined __i386__ ) \
+ || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+# define __GLIBC_HAVE_LONG_LONG 1
+#endif
+#endif
+
/* This is here only because every header file already includes this one. */
#ifndef __ASSEMBLER__
# ifndef _SYS_CDEFS_H
@@ -342,35 +372,39 @@
#ifndef __UCLIBC_HAS_LFS__
/* If uClibc was built without large file support, output an error if
- * and 64-bit file offsets were requested, output an error.
+ * 64-bit file offsets were requested.
* NOTE: This is probably incorrect on a 64-bit arch... */
-#ifdef __USE_FILE_OFFSET64
-#error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
+# ifdef __USE_FILE_OFFSET64
+# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
uClibc was built without large file support enabled.
-#endif
+# endif
/* If uClibc was built without large file support and _LARGEFILE64_SOURCE
* is defined, undefine it. */
-#if defined(_LARGEFILE64_SOURCE)
-#undef _LARGEFILE64_SOURCE
-#undef __USE_LARGEFILE64
-#endif
+# ifdef _LARGEFILE64_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef __USE_LARGEFILE64
+# endif
/* If we're actually building uClibc with large file support,
* define __USE_LARGEFILE64 and __USE_LARGEFILE. */
-#elif defined(_LIBC)
-#undef _LARGEFILE_SOURCE
-#undef _LARGEFILE64_SOURCE
-#undef _FILE_OFFSET_BITS
-#undef __USE_LARGEFILE
-#undef __USE_LARGEFILE64
-#undef __USE_FILE_OFFSET64
-#define _LARGEFILE_SOURCE 1
-#define _LARGEFILE64_SOURCE 1
-#define __USE_LARGEFILE 1
-#define __USE_LARGEFILE64 1
+#elif defined _LIBC
+# undef _LARGEFILE_SOURCE
+# undef _LARGEFILE64_SOURCE
+# undef _FILE_OFFSET_BITS
+# undef __USE_LARGEFILE
+# undef __USE_LARGEFILE64
+# undef __USE_FILE_OFFSET64
+# define _LARGEFILE_SOURCE 1
+# define _LARGEFILE64_SOURCE 1
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
#endif
+/* uClibc does not support *at interfaces. */
+#undef _ATFILE_SOURCE
+#undef __USE_ATFILE
+
#ifdef _LIBC
# include <libc-internal.h>
#endif
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index e363ab641..c5ec2814f 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -55,11 +55,6 @@
# define IS_IN_libc 1
#endif
-/* need this to unset defaults in libpthread for files that get added to libc */
-#ifdef IS_IN_libc
-# undef NOT_IN_libc
-#endif
-
#ifdef __UCLIBC_NO_UNDERSCORES__
# define NO_UNDERSCORES
#else
@@ -320,7 +315,7 @@
}
libc_hidden_weak (foo)
- Simularly for global data. If references to foo within libc.so should
+ Similarly for global data. If references to foo within libc.so should
always go to foo defined in libc.so, then in include/foo.h you add:
libc_hidden_proto (foo)
diff --git a/include/libintl.h b/include/libintl.h
index fd009c3d6..ba57f1698 100644
--- a/include/libintl.h
+++ b/include/libintl.h
@@ -1,5 +1,5 @@
/* Message catalogs for internationalization.
- Copyright (C) 1995-1999, 2000-2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is derived from the file libgettext.h in the GNU gettext package.
@@ -42,22 +42,28 @@ __BEGIN_DECLS
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
-extern char *gettext (__const char *__msgid) __THROW;
+extern char *gettext (__const char *__msgid)
+ __THROW __attribute_format_arg__ (1);
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
extern char *dgettext (__const char *__domainname, __const char *__msgid)
- __THROW;
+ __THROW __attribute_format_arg__ (2);
+#if 0 /* uClibc: disabled */
extern char *__dgettext (__const char *__domainname, __const char *__msgid)
__THROW __attribute_format_arg__ (2);
+#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
extern char *dcgettext (__const char *__domainname,
- __const char *__msgid, int __category) __THROW;
+ __const char *__msgid, int __category)
+ __THROW __attribute_format_arg__ (2);
+#if 0 /* uClibc: disabled */
extern char *__dcgettext (__const char *__domainname,
__const char *__msgid, int __category)
__THROW __attribute_format_arg__ (2);
+#endif
/* Similar to `gettext' but select the plural form corresponding to the
diff --git a/include/link.h b/include/link.h
index 1dd1c4c46..afff90d99 100644
--- a/include/link.h
+++ b/include/link.h
@@ -78,6 +78,10 @@ extern struct r_debug _r_debug;
*/
extern ElfW(Dyn) _DYNAMIC[];
+#ifdef __FRV_FDPIC__
+# include <bits/elf-fdpic.h>
+#endif
+
/* Structure describing a loaded shared object. The `l_next' and `l_prev'
members form a chain of all the shared objects loaded at startup.
@@ -89,7 +93,11 @@ struct link_map
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
+#ifdef __FRV_FDPIC__
+ struct elf32_fdpic_loadaddr l_addr;
+#else
ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+#endif
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
@@ -123,7 +131,11 @@ struct link_map
struct dl_phdr_info
{
+#ifdef __FRV_FDPIC__
+ struct elf32_fdpic_loadaddr dlpi_addr;
+#else
ElfW(Addr) dlpi_addr;
+#endif
const char *dlpi_name;
const ElfW(Phdr) *dlpi_phdr;
ElfW(Half) dlpi_phnum;
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 85f780c47..935886eda 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2001, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <features.h>
#include <stdint.h>
+#include <sys/socket.h>
#include <bits/types.h>
@@ -79,6 +80,8 @@ enum
#define IPPROTO_PIM IPPROTO_PIM
IPPROTO_COMP = 108, /* Compression Header Protocol. */
#define IPPROTO_COMP IPPROTO_COMP
+ IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */
+#define IPPROTO_SCTP IPPROTO_SCTP
IPPROTO_RAW = 255, /* Raw IP packets. */
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MAX
@@ -236,7 +239,30 @@ struct sockaddr_in6
uint32_t sin6_scope_id; /* IPv6 scope-id */
};
-/* IPv6 multicast request. */
+
+/* IPv4 multicast request. */
+struct ip_mreq
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imr_interface;
+ };
+
+struct ip_mreq_source
+ {
+ /* IP multicast address of group. */
+ struct in_addr imr_multiaddr;
+
+ /* IP address of source. */
+ struct in_addr imr_interface;
+
+ /* IP address of interface. */
+ struct in_addr imr_sourceaddr;
+ };
+
+/* Likewise, for IPv6. */
struct ipv6_mreq
{
/* IPv6 multicast address of group */
@@ -246,6 +272,75 @@ struct ipv6_mreq
unsigned int ipv6mr_interface;
};
+
+/* Multicast group request. */
+struct group_req
+ {
+ /* Interface index. */
+ uint32_t gr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gr_group;
+ };
+
+struct group_source_req
+ {
+ /* Interface index. */
+ uint32_t gsr_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gsr_group;
+
+ /* Source address. */
+ struct sockaddr_storage gsr_source;
+ };
+
+
+/* Full-state filter operations. */
+struct ip_msfilter
+ {
+ /* IP multicast address of group. */
+ struct in_addr imsf_multiaddr;
+
+ /* Local IP address of interface. */
+ struct in_addr imsf_interface;
+
+ /* Filter mode. */
+ uint32_t imsf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t imsf_numsrc;
+ /* Source addresses. */
+ struct in_addr imsf_slist[1];
+ };
+
+#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
+ - sizeof (struct in_addr) \
+ + (numsrc) * sizeof (struct in_addr))
+
+struct group_filter
+ {
+ /* Interface index. */
+ uint32_t gf_interface;
+
+ /* Group address. */
+ struct sockaddr_storage gf_group;
+
+ /* Filter mode. */
+ uint32_t gf_fmode;
+
+ /* Number of source addresses. */
+ uint32_t gf_numsrc;
+ /* Source addresses. */
+ struct sockaddr_storage gf_slist[1];
+};
+
+#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
+ - sizeof (struct sockaddr_storage) \
+ + ((numsrc) \
+ * sizeof (struct sockaddr_storage)))
+
+
/* Get system-specific definitions. */
#include <bits/in.h>
@@ -269,9 +364,6 @@ extern uint16_t htons (uint16_t __hostshort)
/* Get machine dependent optimized versions of byte swapping functions. */
#include <bits/byteswap.h>
-#ifndef __OPTIMIZE__
-#define __OPTIMIZE__
-#endif
#ifdef __OPTIMIZE__
/* We can optimize calls to the conversion functions. Either nothing has
to be done or we are using directly the byte-swapping functions which
@@ -367,6 +459,54 @@ struct in6_pktinfo
unsigned int ipi6_ifindex; /* send/recv interface index */
};
+
+#if 0 /*def __USE_GNU*/
+/* Hop-by-Hop and Destination Options Processing. */
+extern int inet6_option_space (int __nbytes) __THROW;
+extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
+ int __type) __THROW;
+extern int inet6_option_append (struct cmsghdr *__cmsg,
+ __const uint8_t *__typep, int __multx,
+ int __plusy) __THROW;
+extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
+ int __multx, int __plusy) __THROW;
+extern int inet6_option_next (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp) __THROW;
+extern int inet6_option_find (__const struct cmsghdr *__cmsg,
+ uint8_t **__tptrp, int __type) __THROW;
+
+
+/* Multicast source filter support. */
+
+/* Get IPv4 source filter. */
+extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t *__fmode,
+ uint32_t *__numsrc, struct in_addr *__slist)
+ __THROW;
+
+/* Set IPv4 source filter. */
+extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
+ struct in_addr __group, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct in_addr *__slist)
+ __THROW;
+
+
+/* Get source filter. */
+extern int getsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t *__fmode,
+ uint32_t *__numsrc,
+ struct sockaddr_storage *__slist) __THROW;
+
+/* Set source filter. */
+extern int setsourcefilter (int __s, uint32_t __interface_addr,
+ __const struct sockaddr *__group,
+ socklen_t __grouplen, uint32_t __fmode,
+ uint32_t __numsrc,
+ __const struct sockaddr_storage *__slist) __THROW;
+#endif /* use GNU */
+
__END_DECLS
#endif /* netinet/in.h */
diff --git a/include/printf.h b/include/printf.h
index 340b6cb9c..569397cd2 100644
--- a/include/printf.h
+++ b/include/printf.h
@@ -154,6 +154,7 @@ struct printf_info
The function should return the number of characters written,
or -1 for errors. */
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__
typedef int (*printf_function) (FILE *__stream,
__const struct printf_info *__info,
__const void *__const *__args);
@@ -172,6 +173,7 @@ typedef int printf_arginfo_function (__const struct printf_info *__info,
extern int register_printf_function (int __spec, printf_function __func,
printf_arginfo_function __arginfo);
+#endif
/* Parse FMT, and fill in N elements of ARGTYPES with the
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 4b2bb0e97..25dd214ee 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -39,13 +39,10 @@
#ifdef _LIBC
/* Some adjustments to make the libc source from glibc
* compile more easily with uClibc... */
-#ifndef __FORCE_GLIBC
-#define __FORCE_GLIBC
-#endif
-#ifndef _GNU_SOUCE
-#define _GNU_SOUCE
-#endif
-#define _(X) X
+# ifndef __FORCE_GLIBC
+# define __FORCE_GLIBC
+# endif
+# define _(X) X
#endif
#include <features.h>
#include <sys/types.h>
@@ -137,7 +134,7 @@ struct XDR
/* returns bytes off from beginning */
bool_t (*x_setpostn) (XDR *__xdrs, u_int __pos);
/* lets you reposition the stream */
- int32_t *(*x_inline) (XDR *__xdrs, int __len);
+ int32_t *(*x_inline) (XDR *__xdrs, u_int __len);
/* buf quick ptr to buffered data */
void (*x_destroy) (XDR *__xdrs);
/* free privates of this xdr_stream */
@@ -150,7 +147,7 @@ struct XDR
caddr_t x_public; /* users' data */
caddr_t x_private; /* pointer to private data */
caddr_t x_base; /* private used for position info */
- int x_handy; /* extra private word */
+ u_int x_handy; /* extra private word */
};
/*
@@ -273,20 +270,8 @@ struct xdr_discrim
* and shouldn't be used any longer. Code which use this defines or longs
* in the RPC code will not work on 64bit Solaris platforms !
*/
-/* #define IXDR_GET_LONG(buf) \ */
-/* ((long)ntohl((u_long)*(*(u_int32_t**)&(buf))++)) */
-/* #define IXDR_PUT_LONG(buf, v) \ */
-/* (*(*(u_int32_t**)&(buf))++ = (long)htonl((u_long)(v))) */
-
-/* WARNING: These macros are not safe against side effects for the 'buf'
- * argument. But the old versions they're replacing took the address of
- * 'buf' and were probably not safe in that situation either. */
-#define IXDR_GET_LONG(buf) \
- ((long) ntohl((u_long) (((u_int32_t *)(buf = (void *)(((char *) buf) + sizeof(u_int32_t))))[-1]) ))
-#define IXDR_PUT_LONG(buf, v) \
- (((u_int32_t *)(buf = (void *)(((char *) buf) + sizeof(u_int32_t))))[-1]) = (long)htonl((u_long)(v))
-
-
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
diff --git a/include/sched.h b/include/sched.h
index 9ed13b10c..9693cc0d1 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
- Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,12 +62,31 @@ extern int sched_get_priority_min (int __algorithm) __THROW;
/* Get the SCHED_RR interval for the named process. */
extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
+
+#if 0 /*def __USE_GNU*/
+/* Access macros for `cpu_set'. */
+#define CPU_SETSIZE __CPU_SETSIZE
+#define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
+#define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp)
+#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
+#define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
+
+
+/* Set the CPU affinity for a task */
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+ __const cpu_set_t *__cpuset) __THROW;
+
+/* Get the CPU affinity for a task */
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+ cpu_set_t *__cpuset) __THROW;
+#endif
+
+__END_DECLS
+
/* These are Linux specific. */
extern int __clone (int (*__fn) (void *__arg), void *__child_stack,
int __flags, void *__arg, ...);
extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
size_t __child_stack_size, int __flags, void *__arg, ...);
-__END_DECLS
-
#endif /* sched.h */
diff --git a/include/signal.h b/include/signal.h
index e4e5a10a8..288febd01 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -93,8 +93,8 @@ extern __sighandler_t signal (int __sig, __sighandler_t __handler)
__THROW;
#else
/* Make sure the used `signal' implementation is the SVID version. */
-# ifdef __REDIRECT
-extern __sighandler_t __REDIRECT (signal,
+# ifdef __REDIRECT_NTH
+extern __sighandler_t __REDIRECT_NTH (signal,
(int __sig, __sighandler_t __handler),
__sysv_signal);
# else
diff --git a/include/stdlib.h b/include/stdlib.h
index 1f0b19b0a..3ed029c07 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -693,10 +693,11 @@ __END_NAMESPACE_C99
#endif
-#if 0 /* defined __USE_SVID || defined __USE_XOPEN_EXTENDED */
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
/* Convert floating point numbers to strings. The returned values are
valid only until another call to the same function. */
+#if 0
/* Convert VALUE to a string with NDIGIT digits and return a pointer to
this. Set *DECPT with the position of the decimal character and *SIGN
with the sign of the number. */
@@ -708,6 +709,7 @@ extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
the number. */
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur;
+#endif
/* If possible convert VALUE to a string with NDIGIT significant digits.
Otherwise use exponential representation. The resulting string will
@@ -716,7 +718,7 @@ extern char *gcvt (double __value, int __ndigit, char *__buf)
__THROW __nonnull ((3)) __wur;
-# ifdef __USE_MISC
+# if 0 /*def __USE_MISC*/
/* Long double versions of above functions. */
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
@@ -845,6 +847,13 @@ extern int getloadavg (double __loadavg[], int __nelem)
__THROW __nonnull ((1));
#endif
+#ifdef __UCLIBC_HAS_ARC4RANDOM__
+#include <stdint.h>
+extern uint32_t arc4random(void);
+extern void arc4random_stir(void);
+extern void arc4random_addrandom(unsigned char *, int);
+#endif
+
#endif /* don't just need malloc and calloc */
#undef __need_malloc_and_calloc
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index eb192cca4..fb53924e9 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -219,7 +219,7 @@
#endif
/* gcc allows marking deprecated functions. */
-#if __GNUC_PREREQ (3,2)
+#if __GNUC_PREREQ (3,2) && !defined(__UCLIBC_HIDE_DEPRECATED__)
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
#else
# define __attribute_deprecated__ /* Ignore */
diff --git a/include/sys/epoll.h b/include/sys/epoll.h
deleted file mode 100644
index 6c310bcff..000000000
--- a/include/sys/epoll.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _SYS_EPOLL_H
-#define _SYS_EPOLL_H 1
-
-#include <stdint.h>
-#include <sys/types.h>
-
-
-enum EPOLL_EVENTS
- {
- EPOLLIN = 0x001,
-#define EPOLLIN EPOLLIN
- EPOLLPRI = 0x002,
-#define EPOLLPRI EPOLLPRI
- EPOLLOUT = 0x004,
-#define EPOLLOUT EPOLLOUT
- EPOLLRDNORM = 0x040,
-#define EPOLLRDNORM EPOLLRDNORM
- EPOLLRDBAND = 0x080,
-#define EPOLLRDBAND EPOLLRDBAND
- EPOLLWRNORM = 0x100,
-#define EPOLLWRNORM EPOLLWRNORM
- EPOLLWRBAND = 0x200,
-#define EPOLLWRBAND EPOLLWRBAND
- EPOLLMSG = 0x400,
-#define EPOLLMSG EPOLLMSG
- EPOLLERR = 0x008,
-#define EPOLLERR EPOLLERR
- EPOLLHUP = 0x010,
-#define EPOLLHUP EPOLLHUP
- EPOLLONESHOT = (1 << 30),
-#define EPOLLONESHOT EPOLLONESHOT
- EPOLLET = (1 << 31)
-#define EPOLLET EPOLLET
- };
-
-
-/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
-#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */
-#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */
-#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */
-
-
-typedef union epoll_data
-{
- void *ptr;
- int fd;
- uint32_t u32;
- uint64_t u64;
-} epoll_data_t;
-
-struct epoll_event
-{
- uint32_t events; /* Epoll events */
- epoll_data_t data; /* User data variable */
-};
-
-
-__BEGIN_DECLS
-
-/* Creates an epoll instance. Returns an fd for the new instance.
- The "size" parameter is a hint specifying the number of file
- descriptors to be associated with the new instance. The fd
- returned by epoll_create() should be closed with close(). */
-extern int epoll_create (int __size) __THROW;
-
-
-/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
- -1 in case of error ( the "errno" variable will contain the
- specific error code ) The "op" parameter is one of the EPOLL_CTL_*
- constants defined above. The "fd" parameter is the target of the
- operation. The "event" parameter describes which events the caller
- is interested in and any associated user data. */
-extern int epoll_ctl (int __epfd, int __op, int __fd,
- struct epoll_event *__event) __THROW;
-
-
-/* Wait for events on an epoll instance "epfd". Returns the number of
- triggered events returned in "events" buffer. Or -1 in case of
- error with the "errno" variable set to the specific error code. The
- "events" parameter is a buffer that will contain triggered
- events. The "maxevents" is the maximum number of events to be
- returned ( usually size of "events" ). The "timeout" parameter
- specifies the maximum wait time in milliseconds (-1 == infinite). */
-extern int epoll_wait (int __epfd, struct epoll_event *__events,
- int __maxevents, int __timeout) __THROW;
-
-__END_DECLS
-
-#endif /* sys/epoll.h */
diff --git a/include/sys/mman.h b/include/sys/mman.h
index 587dff60d..6ad3b9d75 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -99,7 +99,7 @@ extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
#endif
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
be memory resident. */
extern int mlock (__const void *__addr, size_t __len) __THROW;
diff --git a/include/sys/prctl.h b/include/sys/prctl.h
deleted file mode 100644
index 7e9b72d3a..000000000
--- a/include/sys/prctl.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _SYS_PRCTL_H
-#define _SYS_PRCTL_H 1
-
-#include <features.h>
-#include <linux/prctl.h> /* The magic values come from here */
-
-__BEGIN_DECLS
-
-/* Control process execution. */
-extern int prctl (int __option, ...) __THROW;
-
-__END_DECLS
-
-#endif /* sys/prctl.h */
diff --git a/include/sys/sendfile.h b/include/sys/sendfile.h
index 5fcfffbbc..4c1367b6b 100644
--- a/include/sys/sendfile.h
+++ b/include/sys/sendfile.h
@@ -32,19 +32,19 @@ __BEGIN_DECLS
case of error. */
#ifndef __USE_FILE_OFFSET64
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
- size_t __count) __THROW __nonnull ((3));
+ size_t __count) __THROW;
#else
-# ifdef __REDIRECT
-extern ssize_t __REDIRECT (sendfile,
+# ifdef __REDIRECT_NTH
+extern ssize_t __REDIRECT_NTH (sendfile,
(int __out_fd, int __in_fd, __off64_t *__offset,
- size_t __count), sendfile64) __nonnull ((3));
+ size_t __count), sendfile64);
# else
# define sendfile sendfile64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
- size_t __count) __THROW __nonnull ((3));
+ size_t __count) __THROW;
#endif
__END_DECLS
diff --git a/include/sys/syscall.h b/include/sys/syscall.h
index 703188683..aef1f998f 100644
--- a/include/sys/syscall.h
+++ b/include/sys/syscall.h
@@ -20,6 +20,7 @@
#define _SYSCALL_H 1
/* This file provides us with the nicely useful _syscall[0-5] macros. */
+#include <features.h>
#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
# include <bits/syscalls.h>
#else
diff --git a/include/sys/types.h b/include/sys/types.h
index 666681453..087819b02 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -262,8 +262,7 @@ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
/* Now add the thread types. */
-#include <features.h>
-#if (defined __USE_POSIX199506 || defined __USE_UNIX98) && defined UCLIBC_HAS_THREADS
+#if (defined __USE_POSIX199506 || defined __USE_UNIX98) && defined __UCLIBC_HAS_THREADS__
# include <bits/pthreadtypes.h>
#endif
diff --git a/include/time.h b/include/time.h
index 22e6c4b58..da226d5e5 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999,2000,2001,2002,2003,2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -113,6 +114,8 @@ typedef __timer_t timer_t;
defined __need_timespec)
# define __timespec_defined 1
+# include <bits/types.h> /* This defines __time_t for us. */
+
/* POSIX.1b structure for a time value. This is like a `struct timeval' but
has nanoseconds instead of microseconds. */
struct timespec
@@ -343,7 +346,8 @@ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
/* Set clock CLOCK_ID to value TP. */
-extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) __THROW;
+extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
+ __THROW;
#ifdef __UCLIBC_MJN3_ONLY__
#warning "mjn3 FIXME: a bunch of unimplemented function prototypes."
@@ -359,6 +363,7 @@ extern int clock_nanosleep (clockid_t __clock_id, int __flags,
/* Return clock ID for CPU-time clock. */
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
# endif
+#endif /* __UCLIBC_MJN3_ONLY__ */
/* Create new per-process timer using CLOCK_ID. */
@@ -380,7 +385,6 @@ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
/* Get expiration overrun for timer TIMERID. */
extern int timer_getoverrun (timer_t __timerid) __THROW;
-#endif /* __UCLIBC_MJN3_ONLY__ */
# endif
diff --git a/include/unistd.h b/include/unistd.h
index 9ccb0e80f..299283382 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -260,8 +260,20 @@ extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
(as normal file operations use). */
extern int euidaccess (__const char *__name, int __type)
__THROW __nonnull ((1));
+
+/* An alias for `euidaccess', used by some other systems. */
+extern int eaccess (__const char *__name, int __type)
+ __THROW __nonnull ((1));
#endif
+#ifdef __USE_ATFILE
+/* Test for access to FILE relative to the directory FD is open on.
+ If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess',
+ otherwise use real IDs like `access'. */
+extern int faccessat (int __fd, __const char *__file, int __type, int __flag)
+ __THROW __nonnull ((2)) __wur;
+#endif /* Use GNU. */
+
/* Values for the WHENCE argument to lseek. */
#ifndef _STDIO_H /* <stdio.h> has the same definitions. */
@@ -337,16 +349,18 @@ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
__off_t __offset) __wur;
# else
-# ifdef __REDIRECT
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# ifdef __REDIRECT
extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
__off64_t __offset),
pread64) __wur;
extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
size_t __nbytes, __off64_t __offset),
pwrite64) __wur;
-# else
-# define pread pread64
-# define pwrite pwrite64
+# else
+# define pread pread64
+# define pwrite pwrite64
+# endif
# endif
# endif
@@ -431,7 +445,7 @@ extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
#endif /* Use BSD || X/Open Unix. */
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
/* Change the owner and group of FILE relative to the directory FD is open
on. */
extern int fchownat (int __fd, __const char *__file, __uid_t __owner,
@@ -681,29 +695,29 @@ extern int setegid (__gid_t __gid) __THROW;
#endif /* Use BSD. */
#ifdef __USE_GNU
-/* Fetch the effective user ID, real user ID, and saved-set user ID,
+/* Fetch the real user ID, effective user ID, and saved-set user ID,
of the calling process. */
-extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid)
+extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
__THROW;
-/* Fetch the effective group ID, real group ID, and saved-set group ID,
+/* Fetch the real group ID, effective group ID, and saved-set group ID,
of the calling process. */
-extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid)
+extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
__THROW;
-/* Set the effective user ID, real user ID, and saved-set user ID,
- of the calling process to EUID, RUID, and SUID, respectively. */
-extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid)
+/* Set the real user ID, effective user ID, and saved-set user ID,
+ of the calling process to RUID, EUID, and SUID, respectively. */
+extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
__THROW;
-/* Set the effective group ID, real group ID, and saved-set group ID,
- of the calling process to EGID, RGID, and SGID, respectively. */
-extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid)
+/* Set the real group ID, effective group ID, and saved-set group ID,
+ of the calling process to RGID, EGID, and SGID, respectively. */
+extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
__THROW;
#endif
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
/* Clone the calling process, creating an exact copy.
Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
@@ -718,6 +732,9 @@ extern __pid_t fork (void) __THROW;
extern __pid_t vfork (void) __THROW;
#endif /* Use BSD. */
+/* Special exit function which only terminates the current thread. */
+extern void __exit_thread (int val) __attribute__ ((noreturn));
+
/* Return the pathname of the terminal FD is open on, or NULL on errors.
The returned storage is good only until the next call to this function. */
@@ -744,7 +761,7 @@ extern int ttyslot (void) __THROW;
extern int link (__const char *__from, __const char *__to)
__THROW __nonnull ((1, 2)) __wur;
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
/* Like link but relative paths in TO and FROM are interpreted relative
to FROMFD and TOFD respectively. */
extern int linkat (int __fromfd, __const char *__from, int __tofd,
@@ -763,7 +780,7 @@ extern int readlink (__const char *__restrict __path, char *__restrict __buf,
size_t __len) __THROW __nonnull ((1, 2)) __wur;
#endif /* Use BSD. */
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
/* Like symlink but a relative path in TO is interpreted relative to TOFD. */
extern int symlinkat (__const char *__from, int __tofd,
__const char *__to) __THROW __nonnull ((1, 3)) __wur;
@@ -777,7 +794,7 @@ extern int readlinkat (int __fd, __const char *__restrict __path,
/* Remove the link NAME. */
extern int unlink (__const char *__name) __THROW __nonnull ((1));
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
/* Remove the link NAME relative to FD. */
extern int unlinkat (int __fd, __const char *__name, int __flag)
__THROW __nonnull ((2));
@@ -820,6 +837,7 @@ extern int setlogin (__const char *__name) __THROW __nonnull ((1));
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS. */
# define __need_getopt
+/* keep this for uClibc in bits/, we need it when GNU_GETOPT is disabled */
# include <bits/getopt.h>
#endif
@@ -885,7 +903,7 @@ extern void endusershell (void) __THROW; /* Discard cached info. */
extern void setusershell (void) __THROW; /* Rewind and re-read the file. */
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
/* Put the program in the background, and dissociate from the controlling
terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero,
redirects stdin, stdout, and stderr to /dev/null. */
diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index 27a9fc526..b2f06f9ef 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -2,9 +2,9 @@
/*
* epoll_create() / epoll_ctl() / epoll_wait() for uClibc
*
- * Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
@@ -14,52 +14,37 @@
* epoll_create()
*/
#ifdef __NR_epoll_create
-#define __NR___syscall_epoll_create __NR_epoll_create
-static inline _syscall1(int, __syscall_epoll_create, int, size);
-#endif
-
+_syscall1(int, epoll_create, int, size);
+#else
int epoll_create(int size)
{
-#ifdef __NR_epoll_create
- return (__syscall_epoll_create(size));
-#else
__set_errno(ENOSYS);
return -1;
-#endif
}
+#endif
/*
* epoll_ctl()
*/
#ifdef __NR_epoll_ctl
-#define __NR___syscall_epoll_ctl __NR_epoll_ctl
-static inline _syscall4(int, __syscall_epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event);
-#endif
-
+_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event);
+#else
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
{
-#ifdef __NR_epoll_ctl
- return (__syscall_epoll_ctl(epfd, op, fd, event));
-#else
__set_errno(ENOSYS);
return -1;
-#endif
}
+#endif
/*
* epoll_wait()
*/
#ifdef __NR_epoll_wait
-#define __NR___syscall_epoll_wait __NR_epoll_wait
-static inline _syscall4(int, __syscall_epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout);
-#endif
-
+_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout);
+#else
int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{
-#ifdef __NR_epoll_wait
- return (__syscall_epoll_wait(epfd, events, maxevents, timeout));
-#else
__set_errno(ENOSYS);
return -1;
-#endif
}
+#endif
diff --git a/libc/sysdeps/linux/common/prctl.c b/libc/sysdeps/linux/common/prctl.c
index e908c44cd..52d1e76e0 100644
--- a/libc/sysdeps/linux/common/prctl.c
+++ b/libc/sysdeps/linux/common/prctl.c
@@ -2,12 +2,13 @@
/*
* prctl() for uClibc
*
- * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * GNU Library General Public License (LGPL) version 2 or later.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <stdarg.h>
-//#include <sys/prctl.h>
-_syscall5(int, prctl, int, a, int, b, int, c, int, d, int, e);
+/* psm: including sys/prctl.h would depend on kernel headers */
+extern int prctl (int, long, long, long, long);
+_syscall5(int, prctl, int, option, long, arg2, long, arg3, long, arg4, long, arg5);
diff --git a/libm/Makefile.in b/libm/Makefile.in
index 180db7c95..6b07fe43f 100644
--- a/libm/Makefile.in
+++ b/libm/Makefile.in
@@ -44,7 +44,7 @@ endif
FL_MSRC := float_wrappers.c
ifeq ($(DO_C99_MATH),y)
-CSRC := \
+libm_CSRC := \
e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c \
e_exp.c e_fmod.c e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \
e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c e_log.c e_log10.c \
@@ -71,7 +71,7 @@ FL_MOBJ := \
tgammaf.o truncf.o
else
# This list of math functions was taken from POSIX/IEEE 1003.1b-1993
-CSRC := \
+libm_CSRC := \
w_acos.c w_asin.c s_atan.c w_atan2.c s_ceil.c s_cos.c \
w_cosh.c w_exp.c s_fabs.c s_floor.c w_fmod.c s_frexp.c \
s_ldexp.c w_log.c w_log10.c s_modf.c w_pow.c s_sin.c \
@@ -95,7 +95,7 @@ CFLAGS-libm/$(TARGET_ARCH)/ := $(CFLAGS-libm)
# remove generic sources, if arch specific version is present
ifneq ($(strip $(libm_ARCH_SRC)),)
-CSRC := $(filter-out $(notdir $(libm_ARCH_SRC)),$(CSRC))
+libm_CSRC := $(filter-out $(notdir $(libm_ARCH_SRC)),$(libm_CSRC))
endif
# remove generic objects built from multi-sources, if arch specific version is present
@@ -107,7 +107,7 @@ endif
endif
endif
-libm_SRC := $(patsubst %.c,$(libm_DIR)/%.c,$(CSRC))
+libm_SRC := $(patsubst %.c,$(libm_DIR)/%.c,$(libm_CSRC))
libm_OBJ := $(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
libm_MSRC := $(libm_DIR)/$(FL_MSRC)
diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in
index 1c354176c..14fc3ed46 100644
--- a/libnsl/Makefile.in
+++ b/libnsl/Makefile.in
@@ -26,8 +26,6 @@ libnsl-a-y := $(libnsl_OBJ)
endif
libnsl-so-y := $(libnsl_OBJ:.o=.os)
-libnsl-multi-y := $(libnsl_SRC)
-
lib-a-y += $(top_builddir)lib/libnsl.a
lib-so-y += $(top_builddir)lib/libnsl.so
objclean-y += libnsl_clean
diff --git a/libnsl/nsl.c b/libnsl/nsl.c
index 589b2960e..37d5b9369 100644
--- a/libnsl/nsl.c
+++ b/libnsl/nsl.c
@@ -2,26 +2,14 @@
/*
* libnsl for uClibc
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; see the file COPYING.LIB. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <features.h>
+void __stub2(void);
void __stub2(void)
{
return;
diff --git a/libpthread/linuxthreads.old/Makefile.in b/libpthread/linuxthreads.old/Makefile.in
index 249e2f6cb..6ebaa144b 100644
--- a/libpthread/linuxthreads.old/Makefile.in
+++ b/libpthread/linuxthreads.old/Makefile.in
@@ -6,7 +6,8 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
+CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread
+CFLAGS-linuxthreads.old := $(CFLAGS-dir_linuxthreads.old) $(SSP_ALL_CFLAGS)
CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
@@ -56,8 +57,8 @@ libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpt
#
# Stuff that goes into libc.so, not libpthread.so
#
-CFLAGS-forward.c := -DIS_IN_libc
-CFLAGS-libc_pthread_init.c := -DIS_IN_libc
+CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads.old)
+CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads.old)
libpthread_libc_CSRC := forward.c libc_pthread_init.c
libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
diff --git a/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h
index 431da7101..a287e866a 100644
--- a/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h
@@ -18,16 +18,10 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
#ifndef PT_EI
# define PT_EI extern inline __attribute__ ((always_inline))
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
PT_EI long int
testandset (int *spinlock)
{
@@ -35,6 +29,19 @@ testandset (int *spinlock)
/* Note the use of a dummy output of *spinlock to expose the write. The
memory barrier is to stop *other* writes being moved past this code. */
+
+#ifdef __arch_v32
+ __asm__ __volatile__("clearf p\n"
+ "0:\n\t"
+ "movu.b [%2],%0\n\t"
+ "ax\n\t"
+ "move.b %3,[%2]\n\t"
+ "bcs 0b\n\t"
+ "clearf p"
+ : "=&r" (ret), "=m" (*spinlock)
+ : "r" (spinlock), "r" ((int) 1), "m" (*spinlock)
+ : "memory");
+#else /* not __arch_v32 */
__asm__ __volatile__("clearf\n"
"0:\n\t"
"movu.b [%2],%0\n\t"
@@ -43,8 +50,9 @@ testandset (int *spinlock)
"bwf 0b\n\t"
"clearf"
: "=&r" (ret), "=m" (*spinlock)
- : "r" (spinlock), "r" ((int) 1)
+ : "r" (spinlock), "r" ((int) 1), "m" (*spinlock)
: "memory");
+#endif /* __arch_v32 */
return ret;
}
@@ -54,5 +62,3 @@ testandset (int *spinlock)
I don't trust register variables, so let's do this the safe way. */
#define CURRENT_STACK_FRAME \
({ char *sp; __asm__ ("move.d $sp,%0" : "=rm" (sp)); sp; })
-
-#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile
index f92f205a5..f9100219a 100644
--- a/libpthread/linuxthreads/Makefile
+++ b/libpthread/linuxthreads/Makefile
@@ -5,9 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-TOPDIR=../../
-
-top_srcdir=$(TOPDIR)
+top_srcdir=../../
top_builddir=../../
include $(top_builddir)Rules.mak
all: libs
diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index fc3b0b0bd..66f5ac544 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -6,7 +6,8 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
+CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
+CFLAGS-linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
@@ -57,10 +58,10 @@ libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpt
#
# Stuff that goes into libc.so, not libpthread.so
#
-#CFLAGS-alloca_cutoff.c := -DIS_IN_libc
-CFLAGS-forward.c := -DIS_IN_libc
-CFLAGS-libc-cancellation.c := -DIS_IN_libc
-CFLAGS-libc_pthread_init.c := -DIS_IN_libc
+#CFLAGS-OMIT-alloca_cutoff.c := $(CFLAGS-dir_linuxthreads)
+CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads)
+CFLAGS-OMIT-libc-cancellation.c := $(CFLAGS-dir_linuxthreads)
+CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads)
libpthread_libc_CSRC := \
forward.c libc-cancellation.c libc_pthread_init.c # alloca_cutoff.c
libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
diff --git a/libresolv/Makefile.in b/libresolv/Makefile.in
index acf59ea20..a7bb329c7 100644
--- a/libresolv/Makefile.in
+++ b/libresolv/Makefile.in
@@ -26,8 +26,6 @@ libresolv-a-y := $(libresolv_OBJ)
endif
libresolv-so-y := $(libresolv_OBJ:.o=.os)
-libresolv-multi-y := $(libresolv_SRC)
-
lib-a-y += $(top_builddir)lib/libresolv.a
lib-so-y += $(top_builddir)lib/libresolv.so
objclean-y += libresolv_clean
diff --git a/libresolv/resolv.c b/libresolv/resolv.c
index 53f44c34d..38b10ff21 100644
--- a/libresolv/resolv.c
+++ b/libresolv/resolv.c
@@ -2,26 +2,14 @@
/*
* libresolv for uClibc
*
- * Copyright (C) 2002 by Erik Andersen <andersen@uclibc.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <features.h>
+void __stub1(void);
void __stub1(void)
{
return;
diff --git a/librt/Makefile.in b/librt/Makefile.in
index 5fddb5fc6..8a30a18e2 100644
--- a/librt/Makefile.in
+++ b/librt/Makefile.in
@@ -26,8 +26,6 @@ librt-a-y += $(librt_OBJ)
endif
librt-so-y += $(librt_OBJ:.o=.os)
-librt-multi-y += $(librt_SRC)
-
lib-a-y += $(top_builddir)lib/librt.a
lib-so-y += $(top_builddir)lib/librt.so
objclean-y += librt_clean
diff --git a/librt/kernel-posix-cpu-timers.h b/librt/kernel-posix-cpu-timers.h
deleted file mode 100644
index 164a90dde..000000000
--- a/librt/kernel-posix-cpu-timers.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Parameters for the Linux kernel ABI for CPU clocks. */
-
-#define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3))
-#define CPUCLOCK_PERTHREAD(clock) \
- (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0)
-#define CPUCLOCK_PID_MASK 7
-#define CPUCLOCK_PERTHREAD_MASK 4
-#define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
-#define CPUCLOCK_CLOCK_MASK 3
-#define CPUCLOCK_PROF 0
-#define CPUCLOCK_VIRT 1
-#define CPUCLOCK_SCHED 2
-#define CPUCLOCK_MAX 3
-
-#define MAKE_PROCESS_CPUCLOCK(pid, clock) \
- ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
-#define MAKE_THREAD_CPUCLOCK(tid, clock) \
- MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK)
diff --git a/librt/mq_getsetattr.c b/librt/mq_getsetattr.c
index d412beebb..7d2594ea1 100644
--- a/librt/mq_getsetattr.c
+++ b/librt/mq_getsetattr.c
@@ -10,6 +10,8 @@
#ifdef __NR_mq_getsetattr
+librt_hidden_proto(mq_setattr)
+
#define __NR___syscall_mq_getsetattr __NR_mq_getsetattr
static inline _syscall3(int, __syscall_mq_getsetattr, int, mqdes,
const void *, mqstat, void *, omqstat);
@@ -18,18 +20,17 @@ static inline _syscall3(int, __syscall_mq_getsetattr, int, mqdes,
* Set attributes associated with message queue (and possibly also get
* its old attributes)
*/
-attribute_hidden
-int __mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat,
+int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat,
struct mq_attr *omqstat)
{
return __syscall_mq_getsetattr(mqdes, mqstat, omqstat);
}
-strong_alias(__mq_setattr,mq_setattr)
+librt_hidden_def(mq_setattr)
/* Query status and attributes of message queue */
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat)
{
- return __mq_setattr(mqdes, NULL, mqstat);
+ return mq_setattr(mqdes, NULL, mqstat);
}
#endif
diff --git a/librt/mq_receive.c b/librt/mq_receive.c
index 25e3bd25b..c75d9ecb7 100644
--- a/librt/mq_receive.c
+++ b/librt/mq_receive.c
@@ -5,9 +5,10 @@
#include <errno.h>
#include <stddef.h>
#include <sys/syscall.h>
-
#include <mqueue.h>
+librt_hidden_proto(mq_timedreceive)
+
#ifdef __NR_mq_timedreceive
#define __NR___syscall_mq_timedreceive __NR_mq_timedreceive
static inline _syscall5(int, __syscall_mq_timedreceive, int, mqdes,
@@ -19,8 +20,7 @@ static inline _syscall5(int, __syscall_mq_timedreceive, int, mqdes,
* Receive the oldest from highest priority messages.
* Stop waiting if abs_timeout expires.
*/
-attribute_hidden
-ssize_t __mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
+ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
unsigned int *msg_prio,
const struct timespec *abs_timeout)
{
@@ -31,11 +31,11 @@ ssize_t __mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
return -1;
#endif
}
-strong_alias(__mq_timedreceive,mq_timedreceive)
+librt_hidden_def(mq_timedreceive)
/* Receive the oldest from highest priority messages */
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
unsigned int *msg_prio)
{
- return __mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, NULL);
+ return mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, NULL);
}
diff --git a/librt/mq_send.c b/librt/mq_send.c
index 642575915..1dd7db62b 100644
--- a/librt/mq_send.c
+++ b/librt/mq_send.c
@@ -5,9 +5,10 @@
#include <errno.h>
#include <stddef.h>
#include <sys/syscall.h>
-
#include <mqueue.h>
+librt_hidden_proto(mq_timedsend)
+
#ifdef __NR_mq_timedsend
#define __NR___syscall_mq_timedsend __NR_mq_timedsend
static inline _syscall5(int, __syscall_mq_timedsend, int, mqdes,
@@ -19,8 +20,7 @@ static inline _syscall5(int, __syscall_mq_timedsend, int, mqdes,
* Add a message to queue. If O_NONBLOCK is set and queue is full, wait
* for sufficient room in the queue until abs_timeout expires.
*/
-attribute_hidden
-int __mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
+int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
unsigned int msg_prio,
const struct timespec *abs_timeout)
{
@@ -31,11 +31,11 @@ int __mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
return -1;
#endif
}
-strong_alias(__mq_timedsend,mq_timedsend)
+librt_hidden_def(mq_timedsend)
/* Add a message to queue */
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
unsigned int msg_prio)
{
- return __mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, NULL);
+ return mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, NULL);
}
diff --git a/libutil/Makefile.in b/libutil/Makefile.in
index bc6943aeb..b42763d21 100644
--- a/libutil/Makefile.in
+++ b/libutil/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for uClibc
#
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
@@ -17,7 +17,7 @@ libutil_DIR := $(top_srcdir)libutil
libutil_OUT := $(top_builddir)libutil
libutil_SRC := $(wildcard $(libutil_DIR)/*.c)
-ifneq ($(ARCH_HAS_MMU),y)
+ifneq ($(ARCH_USE_MMU),y)
libutil_SRC := $(filter-out $(libutil_DIR)/forkpty.c,$(libutil_SRC))
endif
libutil_OBJ := $(patsubst $(libutil_DIR)/%.c,$(libutil_OUT)/%.o,$(libutil_SRC))
@@ -29,24 +29,32 @@ libutil-a-y := $(libutil_OBJ)
endif
libutil-so-y := $(libutil_OBJ:.o=.os)
-libutil-multi-y := $(libutil_SRC)
-
lib-a-y += $(top_builddir)lib/libutil.a
lib-so-y += $(top_builddir)lib/libutil.so
objclean-y += libutil_clean
+ifeq ($(DOMULTI),n)
ifeq ($(DOPIC),y)
$(top_builddir)lib/libutil.so: $(top_builddir)lib/libutil.a $(libc)
else
$(top_builddir)lib/libutil.so: $(libutil_OUT)/libutil_so.a $(libc)
endif
$(call link.so,$(libutil_FULL_NAME),$(MAJOR_VERSION))
+else
+$(top_builddir)lib/libutil.so: $(libutil_OUT)/libutil.oS | $(libc)
+ $(call linkm.so,$(libutil_FULL_NAME),$(MAJOR_VERSION))
+endif
$(libutil_OUT)/libutil_so.a: $(libutil-so-y)
$(Q)$(RM) $@
$(do_strip)
$(do_ar)
+$(libutil_OUT)/libutil.oS: $(libutil_SRC)
+ $(Q)$(RM) $@
+ $(compile-m)
+ $(do_t_strip)
+
$(top_builddir)lib/libutil.a: $(libutil-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
@@ -54,4 +62,4 @@ $(top_builddir)lib/libutil.a: $(libutil-a-y)
$(do_ar)
libutil_clean:
- $(RM) $(libutil_OUT)/*.{o,os,a}
+ $(RM) $(libutil_OUT)/*.{o,os,oS,a}
diff --git a/libutil/forkpty.c b/libutil/forkpty.c
index 6843221cd..572c22200 100644
--- a/libutil/forkpty.c
+++ b/libutil/forkpty.c
@@ -17,15 +17,15 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define openpty __openpty
-#define login_tty __login_tty
-
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#include <utmp.h>
#include <pty.h>
+libutil_hidden_proto(openpty)
+libutil_hidden_proto(login_tty)
+
int
forkpty (amaster, name, termp, winp)
int *amaster;
diff --git a/libutil/login_tty.c b/libutil/login_tty.c
index 5ae31c52d..3979adcec 100644
--- a/libutil/login_tty.c
+++ b/libutil/login_tty.c
@@ -36,7 +36,8 @@
#include <fcntl.h>
#include <utmp.h>
-int attribute_hidden __login_tty(int fd)
+libutil_hidden_proto(login_tty)
+int login_tty(int fd)
{
(void) setsid();
#ifdef TIOCSCTTY
@@ -67,5 +68,4 @@ int attribute_hidden __login_tty(int fd)
(void) close(fd);
return (0);
}
-
-strong_alias(__login_tty,login_tty)
+libutil_hidden_def(login_tty)
diff --git a/libutil/openpty.c b/libutil/openpty.c
index ac3e496ed..9a65e56b1 100644
--- a/libutil/openpty.c
+++ b/libutil/openpty.c
@@ -27,11 +27,6 @@
#include <unistd.h>
#include <sys/types.h>
-extern int getpt (void);
-extern int grantpt (int fd);
-extern int ptsname_r (int fd, char *buf, size_t buflen);
-extern int unlockpt (int fd);
-
/* BCS: the following function is, IMO, overkill */
#if 0
/* Return the result of ptsname_r in the buffer pointed to by PTS,
@@ -90,8 +85,9 @@ pts_name (int fd, char **pts, size_t buf_len)
/* Create pseudo tty master slave pair and set terminal attributes
according to TERMP and WINP. Return handles for both ends in
AMASTER and ASLAVE, and return the name of the slave end in NAME. */
-int attribute_hidden
-__openpty (int *amaster, int *aslave, char *name, struct termios *termp,
+libutil_hidden_proto(openpty)
+int
+openpty (int *amaster, int *aslave, char *name, struct termios *termp,
struct winsize *winp)
{
#if 0
@@ -158,5 +154,4 @@ __openpty (int *amaster, int *aslave, char *name, struct termios *termp,
close (master);
return -1;
}
-
-strong_alias(__openpty,openpty)
+libutil_hidden_def(openpty)