OSDN Git Service

uclinux-h8/uClibc.git
11 years agotest: silence warning in skeleton
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 09:06:32 +0000 (10:06 +0100)]
test: silence warning in skeleton

Some tests use fd, rename the one in the skeleton.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: silence warning in testsuite.h
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 09:04:10 +0000 (10:04 +0100)]
test: silence warning in testsuite.h

silence warnings about unused parameters

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: update test-skeleton.c
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 08:58:56 +0000 (09:58 +0100)]
test: update test-skeleton.c

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibubacktrace: use libgcc_s.h
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 08:54:02 +0000 (09:54 +0100)]
libubacktrace: use libgcc_s.h

for consistency

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: switch several users to unlikely()
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 08:52:40 +0000 (09:52 +0100)]
libc: switch several users to unlikely()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoinet: res_nclose: free user-buffer, not global _res
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 08:46:21 +0000 (09:46 +0100)]
inet: res_nclose: free user-buffer, not global _res

In res_iclose we were operating on the global _res even if called via
res_nclose where we are supposed to operate on the user provided
res_state.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: dlopen: fix misplaced buildsys hunk
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 07:59:45 +0000 (08:59 +0100)]
test: dlopen: fix misplaced buildsys hunk

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: remove surplus slashes from test dir paths
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 07:43:38 +0000 (08:43 +0100)]
buildsys: remove surplus slashes from test dir paths

cosmetics

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: tweak KCONFIG_CONFIG export
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 07:41:52 +0000 (08:41 +0100)]
buildsys: tweak KCONFIG_CONFIG export

0c3eb2da578bc7ba2e74d240e3249dce62ec725e moved KCONFIG_CONFIG around and
that broke propagation of config-settings to the testsuite. Fix that.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: cater for config
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 06:39:41 +0000 (07:39 +0100)]
test: cater for config

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: compile test{,_glibc} adjacent
Bernhard Reutner-Fischer [Sat, 23 Feb 2013 06:38:36 +0000 (07:38 +0100)]
test: compile test{,_glibc} adjacent

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agometag: Add NPTL support
Markos Chandras [Thu, 18 Nov 2010 14:58:01 +0000 (14:58 +0000)]
metag: Add NPTL support

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoextra/locale: Mark __codeset_8_bit_t as packed for Meta
Markos Chandras [Thu, 24 Mar 2011 11:37:25 +0000 (11:37 +0000)]
extra/locale: Mark __codeset_8_bit_t as packed for Meta

gen_ldc writes offsets into the __locale_mmap_t structure. This
relies on the host system having the same struct offsets as the
target. On Meta, the structs are always aligned to a multiple of
4 bytes, and for these targets it is required for the struct to
be packed so that it is more likely to match the host system
(typically x86 which does not align structs).

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agometag: Add support for loading shared objects into core memories.
Markos Chandras [Tue, 21 Sep 2010 12:43:19 +0000 (12:43 +0000)]
metag: Add support for loading shared objects into core memories.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibm: Add support for the Meta architecture
Markos Chandras [Thu, 26 Nov 2009 10:20:01 +0000 (10:20 +0000)]
libm: Add support for the Meta architecture

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoAdd support for the Meta architecture
Markos Chandras [Tue, 5 Feb 2008 14:51:48 +0000 (14:51 +0000)]
Add support for the Meta architecture

Meta cores are 32-bit, hardware multithreaded, general purpose, embedded
processors which also feature a DSP instruction set, and can be found in
many digital radios. They are capable of running different operating
systems on different hardware threads, for example a digital radio might
run RTOSes for DAB decoding and audio decoding on 3 hardware threads,
and run Linux on the 4th hardware thread to manage the user interface,
networking etc. HTPs are also capable of running SMP Linux on multiple
hardware threads.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoldd: Add MATCH_MACHINE definition for Meta
Markos Chandras [Tue, 2 Feb 2010 17:10:28 +0000 (17:10 +0000)]
ldd: Add MATCH_MACHINE definition for Meta

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoelf: Add ELF magic number and relocations for the Meta architecture
Markos Chandras [Tue, 5 Feb 2008 14:49:08 +0000 (14:49 +0000)]
elf: Add ELF magic number and relocations for the Meta architecture

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoldso: Fix Build warnings with common-generic ABI build
Vineet Gupta [Thu, 14 Mar 2013 12:21:26 +0000 (17:51 +0530)]
ldso: Fix Build warnings with common-generic ABI build

  CC ldso/ldso/ldso.oS
In file included from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./ldso/include/dl-syscall.h:35:1: warning: "S_ISUID" redefined
In file included from ./include/bits/kernel_stat.h:10,
                 from ./ldso/include/dl-syscall.h:31,
                 from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./include/sys/stat.h:163:1: warning: this is the location of the
previous definition
In file included from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./ldso/include/dl-syscall.h:36:1: warning: "S_ISGID" redefined
In file included from ./include/bits/kernel_stat.h:10,
                 from ./ldso/include/dl-syscall.h:31,
                 from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./include/sys/stat.h:164:1: warning: this is the location of the
previous definition

-----------------------------------------------------------------

Cleanly seperated the legacy ABI vs. new ABI scenario.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibpthread: linuxthreads.old: Allow building for no-legacy-syscalls ABI
Vineet Gupta [Thu, 14 Mar 2013 12:21:25 +0000 (17:51 +0530)]
libpthread: linuxthreads.old: Allow building for no-legacy-syscalls ABI

Since NPTL port to an ARCH can be non-trivial, we must allow the legacy
pthread lib to be built for the common-generic syscall ABI

Note that only linuxthreads.old is allowed, since "newer" linuxthreads
relies on sysctl which the ABI no longer provides.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/ipc: Make IPC_64 0 for common-generic ABI
Vineet Gupta [Thu, 14 Mar 2013 12:21:28 +0000 (17:51 +0530)]
libc/ipc: Make IPC_64 0 for common-generic ABI

This avoids having to define __IPC_64 to 0 in each arch using the ABI

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstat64: Fix Build warnings with common-generic ABI build
Vineet Gupta [Thu, 14 Mar 2013 12:21:27 +0000 (17:51 +0530)]
fstat64: Fix Build warnings with common-generic ABI build

  CC libc/sysdeps/linux/common/fstat64.os
In file included from libc/sysdeps/linux/common/fstat64.c:16:
libc/sysdeps/linux/common/xstatconv.h:28: warning: 'struct kernel_stat'
declared inside parameter list
libc/sysdeps/linux/common/xstatconv.h:28: warning: its scope is only
this definition or declaration, which is probably not what you want
libc/sysdeps/linux/common/fstat64.c: In function 'fstat64':
libc/sysdeps/linux/common/fstat64.c:33: warning: passing argument 2 of
'__syscall_fstat64' from incompatible pointer type
libc/sysdeps/linux/common/fstat64.c:18: note: expected 'struct stat *'
but argument is of type 'struct stat64 *'
-------------------------------------------------------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoleek: if lseek syscall is not available, use lseek64 even for !LFS
Vineet Gupta [Thu, 14 Mar 2013 12:21:24 +0000 (17:51 +0530)]
leek: if lseek syscall is not available, use lseek64 even for !LFS

With Busybox and uClibc - both built w/o LFS, this caused ash to be
completely broken, as lseek was simply returning error.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoutimes: Export utimensat based utimes
Vineet Gupta [Thu, 14 Mar 2013 12:21:23 +0000 (17:51 +0530)]
utimes: Export utimensat based utimes

sys/time.h has libc_hidden_proto(utimes) which generates the hidden
"__GI_utimes" symbol reference, and common/utimes.c has a
libc_hidden_def(utimes) which generates the exported "utimes" alias.

As part of no-legacy-syscall kernel ABI, Commit 80dc2ed05
"utimes: Use utimensat if arch does not have the utimes syscall"
introduced a new wrapper, but missed the corresponding libc_hidden_def,
causing Busybox (1.20.0) link to fail (for ARC).

Also don't generate a STUB, in that case.
---------------->8-------------------
....
touch.c:(.text.touch_main+0xdc): undefined reference to `utimes'
touch.c:(.text.touch_main+0x114): undefined reference to `utimes'
libbb/lib.a(copy_file.o): In function `copy_file':
copy_file.c:(.text.copy_file+0x446): undefined reference to `utimes'
collect2: ld returned 1 exit status
---------------->8-------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoLT{,.old}: include stddef.h for size_t
Vineet Gupta [Sat, 9 Mar 2013 06:11:08 +0000 (11:41 +0530)]
LT{,.old}: include stddef.h for size_t

A user application built with -D_POSIX_C_SOURCE=200112L and
 #include signal.h, yields following compilation error:

------------------->8-----------------------------
arc-linux-uclibc-gcc -D_POSIX_C_SOURCE=200112L hello.c
In file included from
/opt/INSTALL/lib/gcc/arc-linux-uclibc/4.4.7/../../../../arc-linux-uclibc/sys-include/signal.h:429,
                 from hello.c:1:
/opt/INSTALL/lib/gcc/arc-linux-uclibc/4.4.7/../../../../arc-linux-uclibc/sys-include/bits/pthreadtypes.h:48:
error: expected specifier-qualifier-list before 'size_t'
------------------->8-----------------------------

The fix is to make sure size_t is explicitly provided to pthreadtype.h

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: Add missing $(SYMBOL_PREFIX) to symbol names
Markos Chandras [Mon, 25 Feb 2013 09:41:25 +0000 (09:41 +0000)]
buildsys: Add missing $(SYMBOL_PREFIX) to symbol names

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibpthread: Remove useless .cvsignore files
Markos Chandras [Sun, 3 Mar 2013 11:48:20 +0000 (11:48 +0000)]
libpthread: Remove useless .cvsignore files

Signed-off-by: Markos Chandras <hwoarang@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonptl/allocatestack.c: Fix stack mprotect alignment for STACK_GROWS_UP
Markos Chandras [Tue, 12 Feb 2013 13:44:25 +0000 (13:44 +0000)]
nptl/allocatestack.c: Fix stack mprotect alignment for STACK_GROWS_UP

mprotect() expects the first argument to be aligned to a page boundary.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/pause: Enable pause_nocancel for arches without __NR_pause
Markos Chandras [Tue, 15 Jan 2013 13:47:31 +0000 (13:47 +0000)]
libc/pause: Enable pause_nocancel for arches without __NR_pause

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonice: fix overflow checking in int_add_no_wrap()
Xi Wang [Wed, 20 Feb 2013 17:45:45 +0000 (12:45 -0500)]
nice: fix overflow checking in int_add_no_wrap()

In C, signed integer overflow is undefined behavior.  Many compilers
optimize away checks like `a + b < a'.

Use safe precondition testing instead.

Signed-off-by: Xi Wang <xi@mit.edu>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoinet: remove noreturn attribute from res_nclose
Bernhard Reutner-Fischer [Wed, 20 Feb 2013 09:09:03 +0000 (10:09 +0100)]
inet: remove noreturn attribute from res_nclose

Partially revert e9af4dfbd328e9f3bba235fdb2d1027dd2dbbcde

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoscripts: remove CVS header from getent
Bernhard Reutner-Fischer [Tue, 19 Feb 2013 07:43:39 +0000 (08:43 +0100)]
scripts: remove CVS header from getent

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/ipc: Allow architectures to define their own __IPC_64 macro
Markos Chandras [Thu, 25 Oct 2012 11:04:02 +0000 (12:04 +0100)]
libc/ipc: Allow architectures to define their own __IPC_64 macro

New architectures don't define ARCH_WANT_IPC_PARSE_VERSION in their kernel.
This means that every cmd passed to semctl,msgctl and shmctl is IPC_64 by
default. For these architectures we need to define __IPC_64 as 0. Existing
architectures are not affected by this change.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoldso: Use newer syscalls if arch does not have the deprecated syscalls
Markos Chandras [Thu, 11 Oct 2012 15:25:32 +0000 (16:25 +0100)]
ldso: Use newer syscalls if arch does not have the deprecated syscalls

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoopen: Use openat if arch does not have the open syscall
Markos Chandras [Wed, 10 Oct 2012 13:26:07 +0000 (14:26 +0100)]
open: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonot-cancel.h: Use openat if arch does not have the open syscall
Markos Chandras [Fri, 12 Oct 2012 10:42:22 +0000 (11:42 +0100)]
not-cancel.h: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoopen64: Use openat if arch does not have the open syscall
Markos Chandras [Fri, 12 Oct 2012 10:28:35 +0000 (11:28 +0100)]
open64: Use openat if arch does not have the open syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofcntl: Use fcntl64 is arch does not have the fcntl syscall
Markos Chandras [Thu, 11 Oct 2012 11:56:48 +0000 (12:56 +0100)]
fcntl: Use fcntl64 is arch does not have the fcntl syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstatfs64: Prefer fstatfs64 system call instead of __libc_fstatfs
Markos Chandras [Thu, 18 Oct 2012 15:51:43 +0000 (16:51 +0100)]
fstatfs64: Prefer fstatfs64 system call instead of __libc_fstatfs

Using __libc_fstatfs for fstatfs64 adds a small delay as it needs to
use a 32-bit data structure to get the file info and them pass them to
the 64-bit data structure which was given as a fstatfs64 argument. Using
the system call directly should make the entire process much faster.
Also fix the arguments for fstatfs64. It takes three arguments
(see fs/fstatfs.c in Linux kernel sources) so despite what the manpage
says, the size of the buffer needs to be passed as the second argument

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstatfs: Add __libc_fstatfs wrapper
Markos Chandras [Thu, 11 Oct 2012 10:58:30 +0000 (11:58 +0100)]
fstatfs: Add __libc_fstatfs wrapper

New architectures don't have fstatfs anymore, so we use a wrapper for
__libc_fstatfs which will use fstatfs64 internally. The interface however
needs to remain the same (i.e accepting a struct statfs as a second
argument) for backwards compatibility

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agostat: Use fstatat64 if arch does not have the stat syscall
Markos Chandras [Thu, 11 Oct 2012 11:15:50 +0000 (12:15 +0100)]
stat: Use fstatat64 if arch does not have the stat syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoustat: Add ustat stub for arches that don't have the ustat system call
Markos Chandras [Fri, 12 Oct 2012 10:20:12 +0000 (11:20 +0100)]
ustat: Add ustat stub for arches that don't have the ustat system call

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolstat64: Use fstatat64 if arch does not have the lstat64 syscall
Markos Chandras [Thu, 11 Oct 2012 11:30:56 +0000 (12:30 +0100)]
lstat64: Use fstatat64 if arch does not have the lstat64 syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolstat: Use fstatat64 if arch does not have the lstat syscall
Markos Chandras [Thu, 11 Oct 2012 11:24:12 +0000 (12:24 +0100)]
lstat: Use fstatat64 if arch does not have the lstat syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agostat64: Use fstatat64 if arch does not have the stat64 syscall
Markos Chandras [Thu, 11 Oct 2012 11:18:54 +0000 (12:18 +0100)]
stat64: Use fstatat64 if arch does not have the stat64 syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstatat{64}: No conversion code is needed for new architectures
Markos Chandras [Tue, 11 Dec 2012 12:51:33 +0000 (12:51 +0000)]
fstatat{64}: No conversion code is needed for new architectures

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstatat64: Use newfstatat only for 64-bit operations
Markos Chandras [Thu, 11 Oct 2012 10:45:45 +0000 (11:45 +0100)]
fstatat64: Use newfstatat only for 64-bit operations

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstatat: Use newfstatat only for 64-bit operations
Markos Chandras [Thu, 11 Oct 2012 10:44:44 +0000 (11:44 +0100)]
fstatat: Use newfstatat only for 64-bit operations

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofstat: Use fstat64 if arch does not have the fstat syscall
Markos Chandras [Mon, 14 Jan 2013 15:57:03 +0000 (15:57 +0000)]
fstat: Use fstat64 if arch does not have the fstat syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/statfs64: Skip conversion code for new architectures
Markos Chandras [Wed, 23 Jan 2013 09:12:46 +0000 (09:12 +0000)]
libc/statfs64: Skip conversion code for new architectures

Fixes the following tests in LTP

statfs02_64 ( test case #5 )

The purpose of this test is to pass an invalid pointer to the statfs64
syscall and check if the kernel returns EFAULT or not. However,
uClibc creates a new statfs struct which is then passed to the kernel.
As a result of which, the kernel returns 0 because the newly created
statfs structure is valid. But, when copying the contens of the new
pointer to the old userspace one, the uClibc segfauls because the old
pointer is invalid. Old architectures are doomed to suffer by this
problem but new architectures can use the statfs64 syscall directly
so that the userspace pointer is passed directly to the kernel and get
the correct errno at the end.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agostatfs: Use statfs64 if arch does not have the statfs syscall
Markos Chandras [Thu, 11 Oct 2012 10:38:44 +0000 (11:38 +0100)]
statfs: Use statfs64 if arch does not have the statfs syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agogetdents: Use getdents64 if arch does not have the getdents syscall
Markos Chandras [Thu, 11 Oct 2012 10:30:59 +0000 (11:30 +0100)]
getdents: Use getdents64 if arch does not have the getdents syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolseek: Use lseek64 is arch does not have the lseek syscall
Markos Chandras [Mon, 21 Jan 2013 10:59:14 +0000 (10:59 +0000)]
lseek: Use lseek64 is arch does not have the lseek syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosendfile: Use sendfile64 if arch does not have the sendfile syscall
Markos Chandras [Thu, 11 Oct 2012 10:20:42 +0000 (11:20 +0100)]
sendfile: Use sendfile64 if arch does not have the sendfile syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotruncate: Use truncate64 if arch does not have the truncate syscall
Markos Chandras [Thu, 11 Oct 2012 10:10:50 +0000 (11:10 +0100)]
truncate: Use truncate64 if arch does not have the truncate syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoftruncate: Use ftruncate64 if arch does not have the ftruncate syscall
Markos Chandras [Thu, 11 Oct 2012 10:08:28 +0000 (11:08 +0100)]
ftruncate: Use ftruncate64 if arch does not have the ftruncate syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofork: Use clone if arch does not have the fork syscall
Markos Chandras [Thu, 11 Oct 2012 10:01:37 +0000 (11:01 +0100)]
fork: Use clone if arch does not have the fork syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agovfork: Use clone if arch does not have the vfork syscall
Markos Chandras [Thu, 11 Oct 2012 09:27:44 +0000 (10:27 +0100)]
vfork: Use clone if arch does not have the vfork syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoutime: Use utimensat if arch does not have the utime syscall
Markos Chandras [Thu, 11 Oct 2012 09:51:33 +0000 (10:51 +0100)]
utime: Use utimensat if arch does not have the utime syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoinotify_init: Use inotify_init1 if inotify_init syscall is not defined
Markos Chandras [Thu, 11 Oct 2012 09:23:19 +0000 (10:23 +0100)]
inotify_init: Use inotify_init1 if inotify_init syscall is not defined

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoepoll: Use epoll_pwait if arch does not have the epoll_wait syscall
Markos Chandras [Wed, 31 Oct 2012 16:02:49 +0000 (16:02 +0000)]
epoll: Use epoll_pwait if arch does not have the epoll_wait syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoepoll: Use epoll_create1 if arch does not have the epoll_create syscall
Markos Chandras [Thu, 11 Oct 2012 09:12:24 +0000 (10:12 +0100)]
epoll: Use epoll_create1 if arch does not have the epoll_create syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agopipe: Use pipe2 if arch does not have the pipe syscall
Markos Chandras [Wed, 10 Oct 2012 15:24:43 +0000 (16:24 +0100)]
pipe: Use pipe2 if arch does not have the pipe syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoutimes: Use utimensat if arch does not have the utimes syscall
Markos Chandras [Wed, 10 Oct 2012 15:06:57 +0000 (16:06 +0100)]
utimes: Use utimensat if arch does not have the utimes syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosymlink: Use symlinkat if arch does not have the symlink syscall
Markos Chandras [Wed, 10 Oct 2012 14:57:41 +0000 (15:57 +0100)]
symlink: Use symlinkat if arch does not have the symlink syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoreadlink: Use readlinkat if arch does not have the readlink syscall
Markos Chandras [Wed, 10 Oct 2012 14:50:28 +0000 (15:50 +0100)]
readlink: Use readlinkat if arch does not have the readlink syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agorename: Use renameat if arch does not have the rename syscall
Markos Chandras [Wed, 10 Oct 2012 14:17:10 +0000 (15:17 +0100)]
rename: Use renameat if arch does not have the rename syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomkdir: Use mkdirat if arch does not have the mkdir syscall
Markos Chandras [Wed, 10 Oct 2012 14:10:27 +0000 (15:10 +0100)]
mkdir: Use mkdirat if arch does not have the mkdir syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolchown: Use fchownat if arch does not have the lchown syscall
Markos Chandras [Wed, 10 Oct 2012 14:09:53 +0000 (15:09 +0100)]
lchown: Use fchownat if arch does not have the lchown syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agormdir: Use unlinkat if arch does not have the rmdir syscall
Markos Chandras [Wed, 10 Oct 2012 14:05:37 +0000 (15:05 +0100)]
rmdir: Use unlinkat if arch does not have the rmdir syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agochown: Use fchownat if arch does not have the chown syscall
Markos Chandras [Wed, 10 Oct 2012 13:56:56 +0000 (14:56 +0100)]
chown: Use fchownat if arch does not have the chown syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomknod: Use mknodat if arch does not have the mknod syscall
Markos Chandras [Wed, 10 Oct 2012 13:53:41 +0000 (14:53 +0100)]
mknod: Use mknodat if arch does not have the mknod syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agounlink: Use unlinkat if arch does not have the unlink syscall
Markos Chandras [Wed, 10 Oct 2012 13:47:21 +0000 (14:47 +0100)]
unlink: Use unlinkat if arch does not have the unlink syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolink: Use linkat if arch does not have the link syscall
Markos Chandras [Wed, 10 Oct 2012 13:45:14 +0000 (14:45 +0100)]
link: Use linkat if arch does not have the link syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoaccess: Use faccessat if arch does not have the access syscall
Markos Chandras [Wed, 10 Oct 2012 12:44:07 +0000 (13:44 +0100)]
access: Use faccessat if arch does not have the access syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agochmod: Use fchmodat if arch does not have the chmod syscall
Markos Chandras [Wed, 10 Oct 2012 12:41:18 +0000 (13:41 +0100)]
chmod: Use fchmodat if arch does not have the chmod syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agodup2: Use dup3 if arch does not have the dup2 syscall
Markos Chandras [Wed, 10 Oct 2012 15:42:37 +0000 (16:42 +0100)]
dup2: Use dup3 if arch does not have the dup2 syscall

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoMakefile.in: Use non-legacy interfaces for new architectures
Markos Chandras [Wed, 28 Nov 2012 11:38:46 +0000 (11:38 +0000)]
Makefile.in: Use non-legacy interfaces for new architectures

New architectures, which don't define ARCH_HAS_DEPRECATED syscalls, need
to use the new interfaces from libc/sysdeps/linux/generic-syscalls/bits/

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoConfig.in: Introduce symbol for arches with deprecated syscalls
Markos Chandras [Fri, 23 Nov 2012 12:36:33 +0000 (12:36 +0000)]
Config.in: Introduce symbol for arches with deprecated syscalls

Linuxthreads(old and new) need deprecated syscalls to build. Existing
architectures support these system calls but new architectures don't.
This symbol has no functional change apart from hidding the Linuxthreads
symbols from arches that don't support them.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/sysdeps: Add new interfaces for new architectures
Markos Chandras [Wed, 28 Nov 2012 11:34:13 +0000 (11:34 +0000)]
libc/sysdeps: Add new interfaces for new architectures

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: add non standard execvpe function
Henning Heinold [Sat, 4 Jun 2011 19:23:15 +0000 (21:23 +0200)]
libc: add non standard execvpe function

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/{arm, i386}/Makefile.arch: Don't build 64-bit code if LFS is disabled
Markos Chandras [Thu, 17 Jan 2013 15:15:17 +0000 (15:15 +0000)]
libc/{arm, i386}/Makefile.arch: Don't build 64-bit code if LFS is disabled

Fixes the following compilation error:

_lfs_64.h: # error Do not include this header in files not built when LFS is disabled

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agostdlib: Fix fndecl of mkostemp, mkostemp64
Bernhard Reutner-Fischer [Sun, 10 Feb 2013 16:21:15 +0000 (17:21 +0100)]
stdlib: Fix fndecl of mkostemp, mkostemp64

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: run test{,_glibc} adjacent
Bernhard Reutner-Fischer [Sun, 10 Feb 2013 15:50:44 +0000 (16:50 +0100)]
test: run test{,_glibc} adjacent

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: add posix_fallocate()
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 07:30:15 +0000 (09:30 +0200)]
libc: add posix_fallocate()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: switch warning into a TODO
Bernhard Reutner-Fischer [Thu, 7 Feb 2013 14:07:50 +0000 (15:07 +0100)]
buildsys: switch warning into a TODO

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: Fix kbuild-style switch fallout
Markos Chandras [Thu, 7 Feb 2013 12:38:44 +0000 (12:38 +0000)]
buildsys: Fix kbuild-style switch fallout

regressions introduced in 1b3025b7352f5e432ffa1c7adc57085ac9092b77
"buildsys: switch libc to kbuild-style"

unistd: Handle !UCLIBC_HAS_GET{, SUB}OPT cases

libc/libc_so.a(getsubopt-susv3.os): In function getsubopt':
getsubopt-susv3.c:(.text+0x0): multiple definition of getsubopt'
libc/libc_so.a(getsubopt.os):getsubopt.c:(.text+0x0):
first defined here.

The solution is to filter out the correct files when
UCLIBC_HAS_GETOPT and UCLIBC_HAS_GETSUBOPT are not defined.

inet: Move INET_RPC_{DIR, OUT} before CSRC_ALL

libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_max_pollfd':
rpc_thread.c:(.text+0x148): undefined reference to svc_max_pollfd'
libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_pollfd':
rpc_thread.c:(.text+0x184): undefined reference to svc_pollfd'

The CSRC_ALL variable uses the INET_RPC_DIR variable which is
initialized later on. We fix this problem by moving the
INET_RCP_{DIR,OUT} definitions before we use them in CSRC_ALL

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomman: rename MAP_UNINITIALIZE to MAP_UNINITIALIZED
Bernhard Reutner-Fischer [Tue, 5 Feb 2013 18:11:36 +0000 (19:11 +0100)]
mman: rename MAP_UNINITIALIZE to MAP_UNINITIALIZED

The name was changed to include a trailing 'D' when it went into the
kernel.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: switch libc to kbuild-style
Bernhard Reutner-Fischer [Tue, 5 Feb 2013 17:54:24 +0000 (18:54 +0100)]
buildsys: switch libc to kbuild-style

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibpthread: Fix handling of SUBARCH includes
Bernhard Reutner-Fischer [Tue, 5 Feb 2013 17:52:47 +0000 (18:52 +0100)]
libpthread: Fix handling of SUBARCH includes

TARGET_SUBARCH can only ever be set if TARGET_ARCH is set.
Only include SUBARCH includes if SUBARCH is non-empty.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: atexit: reuse free slots at the end of exit functions table
Ronald Wahl [Mon, 4 Feb 2013 13:51:46 +0000 (14:51 +0100)]
libc: atexit: reuse free slots at the end of exit functions table

Continuosly dlopen and dlclose of shared object will cause a memory leak
in atexit function. This fix reuse free slots at the end of the list.

For further detail see https://bugs.busybox.net/show_bug.cgi?id=2455

Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Tested-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agolibc/inet: pull in stddef.h for NULL
Mike Frysinger [Sat, 26 Jan 2013 22:43:32 +0000 (17:43 -0500)]
libc/inet: pull in stddef.h for NULL

Fixes a build error:
In file included from libc/inet/recv.c:8:0:
libc/inet/socketcalls.c: In function '__recv_nocancel':
libc/inet/socketcalls.c:203:57: error: 'NULL' undeclared (first use in this function)

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc/sysdeps: sync bits/in.h with glibc
Mike Frysinger [Sat, 26 Jan 2013 22:40:24 +0000 (17:40 -0500)]
libc/sysdeps: sync bits/in.h with glibc

URL: https://bugs.busybox.net/show_bug.cgi?id=5888
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuildsys: gen_bits_syscall_h: do not leave undefined SYS_xxx around
Mike Frysinger [Sat, 26 Jan 2013 19:13:12 +0000 (14:13 -0500)]
buildsys: gen_bits_syscall_h: do not leave undefined SYS_xxx around

If we end up doing '#undef __NR_xxx', we don't want to leave the
corresponding SYS_xxx symbol defined.  So undef it too.

For example, with the ARM EABI layer, we have a bunch of legacy
syscalls that we define early on and then later undefine (such
as __NR_utime).  But we left SYS_utime defined so code that tests
for that define before using it would be broken (since it'd be
defined to a non-existent symbol).

URL: https://bugs.gentoo.org/425006
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuildsys: gen_bits_syscall_h: clean up script
Mike Frysinger [Sat, 26 Jan 2013 19:05:02 +0000 (14:05 -0500)]
buildsys: gen_bits_syscall_h: clean up script

Just style changes here to make it more readable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuildsys: gen_bits_syscall_h: remove top_builddir references
Mike Frysinger [Sat, 26 Jan 2013 19:04:19 +0000 (14:04 -0500)]
buildsys: gen_bits_syscall_h: remove top_builddir references

This script hasn't used this var in a while (it writes to stdout), so
drop all mention/usage of it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuildsys: allow the toolchain to search its dirs for kernel headers
Mike Frysinger [Sat, 26 Jan 2013 18:44:47 +0000 (13:44 -0500)]
buildsys: allow the toolchain to search its dirs for kernel headers

Setting KERNEL_HEADERS up to the exact path all the time is a pita,
especially when the toolchain is often times already configured to
do the right thing.  So if the user has set that to "", don't force
any specific paths.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuildsys: clean up path scrubbing a bit
Mike Frysinger [Sat, 26 Jan 2013 18:43:20 +0000 (13:43 -0500)]
buildsys: clean up path scrubbing a bit

This just makes it easier to read -- no functional changes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc/sysdeps: dup3: fix typo in comment
Mike Frysinger [Sat, 26 Jan 2013 18:18:06 +0000 (13:18 -0500)]
libc/sysdeps: dup3: fix typo in comment

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc: fix typo in statvfs
Bernhard Reutner-Fischer [Mon, 21 Jan 2013 11:21:02 +0000 (12:21 +0100)]
libc: fix typo in statvfs

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>