From 6f810c757e5b14a97f05652972e91f95e321a404 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Wed, 2 Feb 2011 17:58:38 +0100 Subject: sync bits/socket.h PF_* / AF_* values with 2.6.38-rc3 A number of new address / protocol families have been added over the years, so sync with Linux 2.6.38-rc3, adding CAN, ISDN, Phonet, Zigbee, .. which are starting to be used by applications. Signed-off-by: Peter Korsgaard Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/bits/socket.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h index 11f6e9715..7e12733ae 100644 --- a/libc/sysdeps/linux/common/bits/socket.h +++ b/libc/sysdeps/linux/common/bits/socket.h @@ -98,8 +98,18 @@ enum __socket_type #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ +#define PF_LLC 26 /* Linux LLC. */ +#define PF_CAN 29 /* Controller Area Network. */ +#define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ -#define PF_MAX 32 /* For now.. */ +#define PF_IUCV 32 /* IUCV sockets. */ +#define PF_RXRPC 33 /* RxRPC sockets. */ +#define PF_ISDN 34 /* mISDN sockets. */ +#define PF_PHONET 35 /* Phonet sockets. */ +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ +#define PF_CAIF 37 /* CAIF sockets. */ +#define PF_ALG 38 /* Algorithm sockets. */ +#define PF_MAX 39 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -130,7 +140,17 @@ enum __socket_type #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE +#define AF_LLC PF_LLC +#define AF_CAN PF_CAN +#define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH +#define AF_IUCV PF_IUCV +#define AF_RXRPC PF_RXRPC +#define AF_ISDN PF_ISDN +#define AF_PHONET PF_PHONET +#define AF_IEEE802154 PF_IEEE802154 +#define AF_CAIF PF_CAIF +#define AF_ALG PF_ALG #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. -- cgit v1.2.3 From 32814a2b15829df3a144391f5b8bd46e755f85f5 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Thu, 10 Feb 2011 14:30:55 -0800 Subject: Fix GNU make v3.80 compatibility Commits 1f6601a and 094d82d introduced the "else ifeq" construct, which requires GNU make v3.81 or higher. This breaks the build on RHEL4 hosts. Signed-off-by: Kevin Cernekee Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index cf4cf8708..bd45d941b 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -42,9 +42,11 @@ ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CSRC)) ifeq ($(TARGET_ARCH),arm) CSRC := $(filter-out vfork.c, $(CSRC)) -else ifeq ($(TARGET_ARCH),x86_64) +else +ifeq ($(TARGET_ARCH),x86_64) CSRC := $(filter-out vfork.c, $(CSRC)) -else ifeq ($(TARGET_ARCH),mips) +else +ifeq ($(TARGET_ARCH),mips) ifeq ($(CONFIG_MIPS_O32_ABI),y) CSRC := $(filter-out waitpid.c, $(CSRC)) endif @@ -52,6 +54,8 @@ else CSRC := $(filter-out waitpid.c, $(CSRC)) endif endif +endif +endif ifneq ($(ARCH_USE_MMU),y) # stubbed out in mman.h -- cgit v1.2.3 From cdd129dbfe1234c41c7ebee538314417a757b8e8 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 13 Feb 2011 15:56:30 +0100 Subject: nptl: fix typo in buildsys 0f85b228 used 'filter-pout' instead of 'filter-out'. Fix that. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index bd45d941b..30341fd35 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -34,7 +34,7 @@ CSRC := $(filter-out capget.c capset.c inotify.c ioperm.c iopl.c \ sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c,$(CSRC)) ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y) # we need madvise.c in NPTL -CSRC := $(filter-pout madvise.c,$(CSRC)) +CSRC := $(filter-out madvise.c,$(CSRC)) endif endif -- cgit v1.2.3 From e5651d24e38e0a96f9f8ab7a44e34deb08e11084 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 13 Feb 2011 18:31:27 +0100 Subject: buildsys: remove wrong file Somehow Makefile.in ended in there, remove it. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 30341fd35..fdb06c5f4 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -74,7 +74,7 @@ endif ifneq ($(UCLIBC_HAS_REALTIME),y) # aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime -CSRC := $(filter-out clock_getres.c clock_gettime.c clock_settime.c fdatasync.c Makefile.in mlockall.c mlock.c munlockall.c munlock.c nanosleep.c __rt_sigtimedwait.c sched_getparam.c sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c,$(CSRC)) +CSRC := $(filter-out clock_getres.c clock_gettime.c clock_settime.c fdatasync.c mlockall.c mlock.c munlockall.c munlock.c nanosleep.c __rt_sigtimedwait.c sched_getparam.c sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c,$(CSRC)) endif -- cgit v1.2.3 From 18e7136e79a89ba5e978f0dc445a8fcf8d619a40 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 14 Feb 2011 20:54:57 +0100 Subject: buildsys: use kbuild style Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 135 ++++++++++------------------------ 1 file changed, 39 insertions(+), 96 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index fdb06c5f4..229c39164 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -8,127 +8,70 @@ COMMON_DIR := $(top_srcdir)libc/sysdeps/linux/common COMMON_OUT := $(top_builddir)libc/sysdeps/linux/common -CSRC := $(notdir $(wildcard $(COMMON_DIR)/*.c)) +CSRC-y := $(notdir $(wildcard $(COMMON_DIR)/*.c)) +CSRC- := ssp-local.c -ifneq ($(UCLIBC_HAS_LFS),y) CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c)) -CSRC := $(filter-out llseek.c $(CSRC_LFS),$(CSRC)) -endif - -CSRC := $(filter-out ssp-local.c,$(CSRC)) -ifneq ($(UCLIBC_HAS_SSP),y) -CSRC := $(filter-out ssp.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_LINUX_MODULE_24),y) -CSRC := $(filter-out create_module.c query_module.c get_kernel_syms.c,$(CSRC)) -endif +CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y)) +CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS) -ifneq ($(UCLIBC_LINUX_SPECIFIC),y) +CSRC-$(UCLIBC_HAS_SSP) += ssp.c +CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \ + get_kernel_syms.c # we need these internally: fstatfs.c statfs.c -CSRC := $(filter-out capget.c capset.c inotify.c ioperm.c iopl.c \ +CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ modify_ldt.c personality.c ppoll.c prctl.c readahead.c reboot.c \ remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \ sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \ splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \ - sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c,$(CSRC)) -ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y) -# we need madvise.c in NPTL -CSRC := $(filter-out madvise.c,$(CSRC)) -endif -endif - + sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c +CSRC-$(if $(and $(UCLIBC_LINUX_SPECIFIC),$(UCLIBC_HAS_THREADS_NATIVE)),y) += madvise.c +CSRC-$(UCLIBC_HAS_THREADS_NATIVE) += fork.c getpid.c raise.c open.c close.c \ + read.c write.c ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) -CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CSRC)) -ifeq ($(TARGET_ARCH),arm) -CSRC := $(filter-out vfork.c, $(CSRC)) -else -ifeq ($(TARGET_ARCH),x86_64) -CSRC := $(filter-out vfork.c, $(CSRC)) -else -ifeq ($(TARGET_ARCH),mips) -ifeq ($(CONFIG_MIPS_O32_ABI),y) -CSRC := $(filter-out waitpid.c, $(CSRC)) -endif -else -CSRC := $(filter-out waitpid.c, $(CSRC)) -endif +CSRC- += waitpid.c +CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c) +CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c) +CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)),waitpid.c) endif -endif -endif - -ifneq ($(ARCH_USE_MMU),y) # stubbed out in mman.h -CSRC := $(filter-out msync.c, $(CSRC)) -endif - -ifneq ($(UCLIBC_BSD_SPECIFIC),y) +CSRC-$(ARCH_USE_MMU) += msync.c # we need these internally: getdomainname.c -CSRC := $(filter-out mincore.c setdomainname.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_NTP_LEGACY),y) -CSRC := $(filter-out ntp_gettime.c,$(CSRC)) -endif - - -ifneq ($(UCLIBC_HAS_REALTIME),y) +CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c +CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c # aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime -CSRC := $(filter-out clock_getres.c clock_gettime.c clock_settime.c fdatasync.c mlockall.c mlock.c munlockall.c munlock.c nanosleep.c __rt_sigtimedwait.c sched_getparam.c sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c,$(CSRC)) -endif - - -ifneq ($(UCLIBC_HAS_ADVANCED_REALTIME),y) +CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ + fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \ + nanosleep.c __rt_sigtimedwait.c sched_getparam.c \ + sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ + sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_get_info|pthread_mutex_timedlock|sem_timedwait -CSRC := $(filter-out posix_fadvise64.c posix_fadvise.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_SUSV4_LEGACY),y) -CSRC := $(filter-out utime.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_HAS_EPOLL),y) -CSRC := $(filter-out epoll.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_HAS_XATTR),y) -CSRC := $(filter-out xattr.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_HAS_PROFILING),y) -CSRC := $(filter-out noophooks.c pcprofile.c,$(CSRC)) -endif - -ifneq ($(UCLIBC_SV4_DEPRECATED),y) -CSRC := $(filter-out ustat.c,$(CSRC)) -endif - -ifeq ($(TARGET_ARCH),sh) -CSRC := $(filter-out longjmp.c vfork.c,$(CSRC)) -endif - -ifeq ($(TARGET_ARCH),sparc) -CSRC := $(filter-out vfork.c,$(CSRC)) -endif - -ifeq ($(TARGET_ARCH),i386) -CSRC := $(filter-out vfork.c,$(CSRC)) -endif +CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c +CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c +CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c +CSRC-$(UCLIBC_HAS_XATTR) += xattr.c +CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c +CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c +CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),longjmp.c vfork.c) +CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c) +CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c) + +CSRC-y := $(filter-out $(CSRC-),$(CSRC-y)) # provided via pthreads builddir -CSRC := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC)) +CSRC-y := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC-y)) SSRC := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC)) # fails for some reason ifneq ($(strip $(ARCH_OBJS)),) -CSRC := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC)) +CSRC-y := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC-y)) endif CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS) CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS) -COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC)) -COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC)) +COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC-y)) +COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC-y)) libc-y += $(COMMON_OBJ) libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o -- cgit v1.2.3 From 0f4516e32c3a2186e6b6f074cfc6a57bde90e9cc Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 16 Feb 2011 19:31:06 +0100 Subject: buildsys: fix inverted logic with thread impls Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 229c39164..a6d22e544 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -26,13 +26,12 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \ sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c CSRC-$(if $(and $(UCLIBC_LINUX_SPECIFIC),$(UCLIBC_HAS_THREADS_NATIVE)),y) += madvise.c -CSRC-$(UCLIBC_HAS_THREADS_NATIVE) += fork.c getpid.c raise.c open.c close.c \ - read.c write.c ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) +CSRC- += fork.c getpid.c raise.c open.c close.c read.c write.c CSRC- += waitpid.c CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c) -CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)),waitpid.c) +CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)=),waitpid.c) endif # stubbed out in mman.h CSRC-$(ARCH_USE_MMU) += msync.c -- cgit v1.2.3 From 9bc14fb42980b738abfcd8be8cffcca0937b5220 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 22 Feb 2011 18:12:26 +0100 Subject: nptl: imit waitpid just for MIPS O32 Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 1 - 1 file changed, 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index a6d22e544..302fa6450 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -28,7 +28,6 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ CSRC-$(if $(and $(UCLIBC_LINUX_SPECIFIC),$(UCLIBC_HAS_THREADS_NATIVE)),y) += madvise.c ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) CSRC- += fork.c getpid.c raise.c open.c close.c read.c write.c -CSRC- += waitpid.c CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)=),waitpid.c) -- cgit v1.2.3 From 73d59554144f429b1cf0d4d7fa7de42bdf59ad92 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 23 Jul 2009 01:11:38 -0400 Subject: unify stub logic Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/common/__rt_sigtimedwait.c | 12 +- libc/sysdeps/linux/common/__rt_sigwaitinfo.c | 11 +- libc/sysdeps/linux/common/bdflush.c | 6 - libc/sysdeps/linux/common/capget.c | 6 - libc/sysdeps/linux/common/capset.c | 7 +- libc/sysdeps/linux/common/create_module.c | 7 - libc/sysdeps/linux/common/delete_module.c | 6 - libc/sysdeps/linux/common/epoll.c | 18 --- libc/sysdeps/linux/common/fdatasync.c | 7 - libc/sysdeps/linux/common/fork.c | 12 -- libc/sysdeps/linux/common/get_kernel_syms.c | 6 - libc/sysdeps/linux/common/getpgrp.c | 6 - libc/sysdeps/linux/common/init_module.c | 6 - libc/sysdeps/linux/common/pivot_root.c | 6 - libc/sysdeps/linux/common/posix_fadvise.c | 3 +- libc/sysdeps/linux/common/posix_fadvise64.c | 3 +- libc/sysdeps/linux/common/query_module.c | 7 - libc/sysdeps/linux/common/sched_getaffinity.c | 6 - libc/sysdeps/linux/common/sched_setaffinity.c | 11 -- libc/sysdeps/linux/common/signalfd.c | 6 +- libc/sysdeps/linux/common/splice.c | 7 - libc/sysdeps/linux/common/stubs.c | 183 ++++++++++++++++++++++++++ libc/sysdeps/linux/common/sync_file_range.c | 6 - libc/sysdeps/linux/common/umount.c | 9 -- libc/sysdeps/linux/common/umount2.c | 6 - libc/sysdeps/linux/common/vmsplice.c | 7 - libc/sysdeps/linux/common/xattr.c | 78 ----------- 27 files changed, 189 insertions(+), 259 deletions(-) create mode 100644 libc/sysdeps/linux/common/stubs.c (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c index a7ab8fb61..26860d2d2 100644 --- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c +++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c @@ -86,16 +86,6 @@ int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, return __rt_sigtimedwait(set, info, timeout, _NSIG / 8); } # endif /* !__UCLIBC_HAS_THREADS_NATIVE__ */ -#else -int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, - const struct timespec *timeout) -{ - if (set == NULL) - __set_errno(EINVAL); - else - __set_errno(ENOSYS); - return -1; -} -#endif weak_alias(__sigtimedwait,sigtimedwait) libc_hidden_weak(sigtimedwait) +#endif diff --git a/libc/sysdeps/linux/common/__rt_sigwaitinfo.c b/libc/sysdeps/linux/common/__rt_sigwaitinfo.c index 92a11c9b6..6b4332715 100644 --- a/libc/sysdeps/linux/common/__rt_sigwaitinfo.c +++ b/libc/sysdeps/linux/common/__rt_sigwaitinfo.c @@ -83,16 +83,7 @@ int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) return __rt_sigwaitinfo(set, info, NULL, _NSIG / 8); } # endif -#else -int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) -{ - if (set == NULL) - __set_errno(EINVAL); - else - __set_errno(ENOSYS); - return -1; -} -#endif libc_hidden_proto(sigwaitinfo) weak_alias (__sigwaitinfo, sigwaitinfo) libc_hidden_weak(sigwaitinfo) +#endif diff --git a/libc/sysdeps/linux/common/bdflush.c b/libc/sysdeps/linux/common/bdflush.c index 687a8f9a7..c2a05ed88 100644 --- a/libc/sysdeps/linux/common/bdflush.c +++ b/libc/sysdeps/linux/common/bdflush.c @@ -12,10 +12,4 @@ #ifdef __NR_bdflush _syscall2(int, bdflush, int, __func, long int, __data) -#else -int bdflush(int __func, long int __data) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/capget.c b/libc/sysdeps/linux/common/capget.c index 361de845d..c3e8c5771 100644 --- a/libc/sysdeps/linux/common/capget.c +++ b/libc/sysdeps/linux/common/capget.c @@ -11,10 +11,4 @@ int capget(void *header, void *data); #ifdef __NR_capget _syscall2(int, capget, void *, header, void *, data) -#else -int capget(void *header, void *data) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/capset.c b/libc/sysdeps/linux/common/capset.c index 0a77e05f4..c0cf5deb0 100644 --- a/libc/sysdeps/linux/common/capset.c +++ b/libc/sysdeps/linux/common/capset.c @@ -8,13 +8,8 @@ */ #include + int capset(void *header, const void *data); #ifdef __NR_capset _syscall2(int, capset, void *, header, const void *, data) -#elif defined __UCLIBC_HAS_STUBS__ -int capset(void *header, const void *data) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index d8f24466d..ddd7c4cff 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -49,11 +49,4 @@ unsigned long create_module(const char *name, size_t size) _syscall2(unsigned long, create_module, const char *, name, size_t, size) #endif -#else /* !__NR_create_module */ -caddr_t create_module(const char *name attribute_unused, size_t size attribute_unused); -caddr_t create_module(const char *name attribute_unused, size_t size attribute_unused) -{ - __set_errno(ENOSYS); - return (caddr_t)-1; -} #endif diff --git a/libc/sysdeps/linux/common/delete_module.c b/libc/sysdeps/linux/common/delete_module.c index 44f9b30ae..8ac6e559e 100644 --- a/libc/sysdeps/linux/common/delete_module.c +++ b/libc/sysdeps/linux/common/delete_module.c @@ -10,10 +10,4 @@ int delete_module(const char *name, unsigned int flags); #ifdef __NR_delete_module _syscall2(int, delete_module, const char *, name, unsigned int, flags) -#elif defined __UCLIBC_HAS_STUBS__ -int delete_module(const char *name, unsigned int flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index 86272d9aa..dda92282e 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -15,12 +15,6 @@ */ #ifdef __NR_epoll_create _syscall1(int, epoll_create, int, size) -#else -int epoll_create(int size) -{ - __set_errno(ENOSYS); - return -1; -} #endif /* @@ -28,12 +22,6 @@ int epoll_create(int size) */ #ifdef __NR_epoll_ctl _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) -{ - __set_errno(ENOSYS); - return -1; -} #endif /* @@ -41,10 +29,4 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) */ #ifdef __NR_epoll_wait _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) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/fdatasync.c b/libc/sysdeps/linux/common/fdatasync.c index 19d37b6e0..e51c72365 100644 --- a/libc/sysdeps/linux/common/fdatasync.c +++ b/libc/sysdeps/linux/common/fdatasync.c @@ -40,11 +40,4 @@ int fdatasync(int fd) # endif } -#elif defined __UCLIBC_HAS_STUBS__ -/* no syscall available, so provide a stub */ -int fdatasync(int fd) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index f21ec35b8..14e00a2cd 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -20,16 +20,4 @@ weak_alias(__libc_fork,fork) libc_hidden_weak(fork) #endif -#elif defined __UCLIBC_HAS_STUBS__ - -extern __typeof(fork) __libc_fork; -pid_t __libc_fork(void) -{ - __set_errno(ENOSYS); - return -1; -} -weak_alias(__libc_fork,fork) -libc_hidden_weak(fork) -link_warning(fork, "fork: this function is not implemented on no-mmu systems") - #endif diff --git a/libc/sysdeps/linux/common/get_kernel_syms.c b/libc/sysdeps/linux/common/get_kernel_syms.c index d6595eaf5..6124a81d4 100644 --- a/libc/sysdeps/linux/common/get_kernel_syms.c +++ b/libc/sysdeps/linux/common/get_kernel_syms.c @@ -13,10 +13,4 @@ struct kernel_sym; int get_kernel_syms(struct kernel_sym *table attribute_unused); #ifdef __NR_get_kernel_syms _syscall1(int, get_kernel_syms, struct kernel_sym *, table) -#else -int get_kernel_syms(struct kernel_sym *table attribute_unused) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/getpgrp.c b/libc/sysdeps/linux/common/getpgrp.c index 5d36ba155..80a53daee 100644 --- a/libc/sysdeps/linux/common/getpgrp.c +++ b/libc/sysdeps/linux/common/getpgrp.c @@ -19,10 +19,4 @@ pid_t getpgrp(void) { return getpgid(getpid()); } -#elif defined __UCLIBC_HAS_STUBS__ -pid_t getpgrp(void) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/init_module.c b/libc/sysdeps/linux/common/init_module.c index 8a6e94199..cf6d74721 100644 --- a/libc/sysdeps/linux/common/init_module.c +++ b/libc/sysdeps/linux/common/init_module.c @@ -15,11 +15,5 @@ int init_module(void *first, void *second, void *third, void *fourth, void *fift * and let the kernel cope with whatever it gets. It's good at that. */ _syscall5(int, init_module, void *, first, void *, second, void *, third, void *, fourth, void *, fifth) -#else -int init_module(void *first, void *second, void *third, void *fourth, void *fifth) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/pivot_root.c b/libc/sysdeps/linux/common/pivot_root.c index 3e9705903..0e738d53f 100644 --- a/libc/sysdeps/linux/common/pivot_root.c +++ b/libc/sysdeps/linux/common/pivot_root.c @@ -12,10 +12,4 @@ int pivot_root(const char *new_root, const char *put_old); #ifdef __NR_pivot_root _syscall2(int, pivot_root, const char *, new_root, const char *, put_old) -#else -int pivot_root(const char *new_root, const char *put_old) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index 7c43be959..17831c201 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -27,10 +27,9 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice) strong_alias(posix_fadvise,posix_fadvise64) #endif -#else +#elif defined __UCLIBC_HAS_STUBS__ int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused) { -#warning This is not correct as far as SUSv3 is concerned. return ENOSYS; } #endif diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c index b53e64321..e8a530fdf 100644 --- a/libc/sysdeps/linux/common/posix_fadvise64.c +++ b/libc/sysdeps/linux/common/posix_fadvise64.c @@ -58,13 +58,12 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) #error your machine is neither 32 bit or 64 bit ... it must be magical #endif -#elif !defined __NR_fadvise64 +#elif !defined __NR_fadvise64 && defined __UCLIBC_HAS_STUBS__ /* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64 * is defined. */ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { -#warning This is not correct as far as SUSv3 is concerned. return ENOSYS; } #endif /* __NR_fadvise64_64 */ diff --git a/libc/sysdeps/linux/common/query_module.c b/libc/sysdeps/linux/common/query_module.c index 0f3d4700c..7c168df45 100644 --- a/libc/sysdeps/linux/common/query_module.c +++ b/libc/sysdeps/linux/common/query_module.c @@ -13,11 +13,4 @@ int query_module(const char *name attribute_unused, int which attribute_unused, #ifdef __NR_query_module _syscall5(int, query_module, const char *, name, int, which, void *, buf, size_t, bufsize, size_t *, ret) -#elif defined __UCLIBC_HAS_STUBS__ -int query_module(const char *name attribute_unused, int which attribute_unused, - void *buf attribute_unused, size_t bufsize attribute_unused, size_t * ret attribute_unused) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/sched_getaffinity.c b/libc/sysdeps/linux/common/sched_getaffinity.c index 5d5e5b2c4..8982582cc 100644 --- a/libc/sysdeps/linux/common/sched_getaffinity.c +++ b/libc/sysdeps/linux/common/sched_getaffinity.c @@ -44,11 +44,5 @@ int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) } return res; } -#elif defined __UCLIBC_HAS_STUBS__ -int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) -{ - __set_errno(ENOSYS); - return -1; -} #endif #endif diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c index 1a0f55f75..980c44199 100644 --- a/libc/sysdeps/linux/common/sched_setaffinity.c +++ b/libc/sysdeps/linux/common/sched_setaffinity.c @@ -70,16 +70,5 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset); } -#else -#define ___HAVE_NO_sched_setaffinity #endif - -#if defined ___HAVE_NO_sched_setaffinity && defined __UCLIBC_HAS_STUBS__ -int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) -{ - __set_errno(ENOSYS); - return -1; -} -#endif - #endif /* __USE_GNU */ diff --git a/libc/sysdeps/linux/common/signalfd.c b/libc/sysdeps/linux/common/signalfd.c index 3d76e04c4..a0c995a89 100644 --- a/libc/sysdeps/linux/common/signalfd.c +++ b/libc/sysdeps/linux/common/signalfd.c @@ -21,8 +21,7 @@ static __inline__ _syscall3(int, __syscall_signalfd, int, fd, const sigset_t *, mask, size_t, sizemask) #endif -#if defined __NR_signalfd4 || defined __NR_signalfd \ - || defined __UCLIBC_HAS_STUBS__ +#if defined __NR_signalfd4 || defined __NR_signalfd int signalfd (int fd, const sigset_t *mask, int flags) { #if defined __NR___syscall_signalfd4 @@ -33,9 +32,6 @@ int signalfd (int fd, const sigset_t *mask, int flags) return -1; } return __syscall_signalfd(fd, mask, _NSIG / 8); -#elif defined __UCLIBC_HAS_STUBS__ - __set_errno(ENOSYS); - return -1; #endif } #endif diff --git a/libc/sysdeps/linux/common/splice.c b/libc/sysdeps/linux/common/splice.c index b21d10336..83f348a48 100644 --- a/libc/sysdeps/linux/common/splice.c +++ b/libc/sysdeps/linux/common/splice.c @@ -13,11 +13,4 @@ #ifdef __NR_splice _syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout, __off64_t *, __offout, size_t, __len, unsigned int, __flags) -#else -ssize_t splice(int __fdin, __off64_t *__offin, int __fdout, - __off64_t *__offout, size_t __len, unsigned int __flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c new file mode 100644 index 000000000..dd4a384f8 --- /dev/null +++ b/libc/sysdeps/linux/common/stubs.c @@ -0,0 +1,183 @@ +/* + * system call not available stub + * + * Copyright (C) 2009 Analog Devices Inc. + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include + +#ifdef __UCLIBC_HAS_STUBS__ + +attribute_hidden int enosys_stub(void); +libc_hidden_proto(enosys_stub) + +attribute_hidden int enosys_stub(void) +{ + __set_errno(ENOSYS); + return -1; +} +libc_hidden_def(enosys_stub) + +#define make_stub(stub) \ + link_warning(stub, #stub ": this function is not implemented") \ + strong_alias(enosys_stub, stub) + +#ifndef __ARCH_USE_MMU__ +# undef __NR_fork +#endif + +#ifndef __UCLIBC_HAS_LFS__ +# undef __NR_fadvise64 +# undef __NR_fadvise64_64 +# undef __NR_sync_file_range +#endif + +#ifndef __NR_bdflush +make_stub(bdflush) +#endif + +#ifndef __NR_capget +make_stub(capget) +#endif + +#ifndef __NR_capset +make_stub(capset) +#endif + +#ifndef __NR_create_module +make_stub(create_module) +#endif + +#ifndef __NR_delete_module +make_stub(delete_module) +#endif + +#ifndef __NR_epoll_create +make_stub(epoll_create) +#endif + +#ifndef __NR_epoll_ctl +make_stub(epoll_ctl) +#endif + +#ifndef __NR_epoll_wait +make_stub(epoll_wait) +#endif + +#ifndef __NR_fdatasync +make_stub(fdatasync) +#endif + +#ifndef __NR_flistxattr +make_stub(flistxattr) +#endif + +#ifndef __NR_fork +make_stub(fork) +#endif + +#ifndef __NR_fgetxattr +make_stub(fgetxattr) +#endif + +#ifndef __NR_fremovexattr +make_stub(fremovexattr) +#endif + +#ifndef __NR_fsetxattr +make_stub(fsetxattr) +#endif + +#ifndef __NR_get_kernel_syms +make_stub(get_kernel_syms) +#endif + +#if !defined(__NR_getpgrp) && (defined(__NR_getpgid) && (defined(__NR_getpid) || defined(__NR_getxpid))) +make_stub(getpgrp) +#endif + +#ifndef __NR_getxattr +make_stub(getxattr) +#endif + +#ifndef __NR_init_module +make_stub(init_module) +#endif + +#ifndef __NR_lgetxattr +make_stub(lgetxattr) +#endif + +#ifndef __NR_listxattr +make_stub(listxattr) +#endif + +#ifndef __NR_llistxattr +make_stub(llistxattr) +#endif + +#ifndef __NR_lremovexattr +make_stub(lremovexattr) +#endif + +#ifndef __NR_lsetxattr +make_stub(lsetxattr) +#endif + +#ifndef __NR_pivot_root +make_stub(pivot_root) +#endif + +#ifndef __NR_query_module +make_stub(query_module) +#endif + +#ifndef __NR_removexattr +make_stub(removexattr) +#endif + +#ifndef __NR_sched_getaffinity +make_stub(sched_getaffinity) +#endif + +#ifndef __NR_sched_setaffinity +make_stub(sched_setaffinity) +#endif + +#ifndef __NR_setxattr +make_stub(setxattr) +#endif + +#if !defined(__NR_signalfd4) && !defined(__NR_signalfd) +make_stub(signalfd) +#endif + +#ifndef __NR_rt_sigtimedwait +make_stub(sigtimedwait) +make_stub(sigwaitinfo) +#endif + +#ifndef __NR_splice +make_stub(splice) +#endif + +#ifndef __NR_sync_file_range +make_stub(sync_file_range) +#endif + +#if !defined(__NR_umount) && !defined(__NR_umount2) +make_stub(umount) +#endif + +#ifndef __NR_umount2 +make_stub(umount2) +#endif + +#ifndef __NR_vmsplice +make_stub(vmsplice) +#endif + +#endif diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index 7e2deff41..d24403e1b 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -23,11 +23,5 @@ int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags) __LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)), flags); } -#elif defined __UCLIBC_HAS_STUBS__ -int sync_file_range(int fd, __off64_t offset, __off64_t nbytes, unsigned int flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif #endif diff --git a/libc/sysdeps/linux/common/umount.c b/libc/sysdeps/linux/common/umount.c index 453ecd27b..a084d29bd 100644 --- a/libc/sysdeps/linux/common/umount.c +++ b/libc/sysdeps/linux/common/umount.c @@ -28,14 +28,5 @@ int umount(const char *special_file) return (__syscall_umount2(special_file, 0)); } -/* arch doesn't provide any umount syscall !? */ -#else - -int umount(const char *special_file) -{ - __set_errno(ENOSYS); - return -1; -} - #endif #endif diff --git a/libc/sysdeps/linux/common/umount2.c b/libc/sysdeps/linux/common/umount2.c index bd44717d4..2cc4a2338 100644 --- a/libc/sysdeps/linux/common/umount2.c +++ b/libc/sysdeps/linux/common/umount2.c @@ -13,11 +13,5 @@ #include #ifdef __NR_umount2 /* Old kernels don't have umount2 */ _syscall2(int, umount2, const char *, special_file, int, flags) -#else -int umount2(const char *special_file, int flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif #endif diff --git a/libc/sysdeps/linux/common/vmsplice.c b/libc/sysdeps/linux/common/vmsplice.c index c5fd6c7ed..dd0640e1e 100644 --- a/libc/sysdeps/linux/common/vmsplice.c +++ b/libc/sysdeps/linux/common/vmsplice.c @@ -13,11 +13,4 @@ #ifdef __NR_vmsplice _syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov, size_t, __count, unsigned int, __flags) -#else -ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count, - unsigned int __flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif diff --git a/libc/sysdeps/linux/common/xattr.c b/libc/sysdeps/linux/common/xattr.c index 8a4e3be29..dea471ad6 100644 --- a/libc/sysdeps/linux/common/xattr.c +++ b/libc/sysdeps/linux/common/xattr.c @@ -29,136 +29,58 @@ #ifdef __NR_setxattr _syscall5(int, setxattr, const char *, path, const char *, name, const void *, value, size_t, size, int, flags) -#else -int setxattr(__const char *__path, __const char *__name, - __const void *__value, size_t __size, int __flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_lsetxattr _syscall5(int, lsetxattr, const char *, path, const char *, name, const void *, value, size_t, size, int, flags) -#else -int lsetxattr(__const char *__path, __const char *__name, - __const void *__value, size_t __size, int __flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_fsetxattr _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *, value, size_t, size, int, flags) -#else -int fsetxattr(int __fd, __const char *__name, __const void *__value, - size_t __size, int __flags) -{ - __set_errno(ENOSYS); - return -1; -} #endif /* gets */ #ifdef __NR_getxattr _syscall4(ssize_t, getxattr, const char *, path, const char *, name, void *, value, size_t, size) -#else -ssize_t getxattr(__const char *__path, __const char *__name, void *__value, - size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_lgetxattr _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name, void *, value, size_t, size) -#else -ssize_t lgetxattr(__const char *__path, __const char *__name, - void *__value, size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_fgetxattr _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *, value, size_t, size) -#else -ssize_t fgetxattr(int __fd, __const char *__name, void *__value, - size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif /* list */ #ifdef __NR_listxattr _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t, size) -#else -ssize_t listxattr(__const char *__path, char *__list, size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_llistxattr _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t, size) -#else -ssize_t llistxattr(__const char *__path, char *__list, size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_flistxattr _syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size) -#else -ssize_t flistxattr(int __fd, char *__list, size_t __size) -{ - __set_errno(ENOSYS); - return -1; -} #endif /* remove */ #ifdef __NR_removexattr _syscall2(int, removexattr, const char *, path, const char *, name) -#else -int removexattr(__const char *__path, __const char *__name) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_lremovexattr _syscall2(int, lremovexattr, const char *, path, const char *, name) -#else -int lremovexattr(__const char *__path, __const char *__name) -{ - __set_errno(ENOSYS); - return -1; -} #endif #ifdef __NR_fremovexattr _syscall2(int, fremovexattr, int, filedes, const char *, name) -#else -int fremovexattr(int __fd, __const char *__name) -{ - __set_errno(ENOSYS); - return -1; -} #endif -- cgit v1.2.3 From be88a80858ea4febcc621f87166fbf4c1753e513 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Mon, 7 Feb 2011 18:03:36 +0100 Subject: nptl:arm: add a wrapper for .cfi_sections pseudo-ops ARM disables by default the support for ASM CFI directives. Anyway using an old version of binutils that does not support some new pseudo-op, the build fails as below: AS libpthread/nptl/sysdeps/unix/sysv/linux/close.oS libpthread/nptl/sysdeps/unix/sysv/linux/close.S: Assembler messages: libpthread/nptl/sysdeps/unix/sysv/linux/close.S:9: Error: unknown pseudo-op: `.cfi_sections' The problem is that the .cfi_sections pseudo should be wrapped by a macro that expands to nothing when the CFI is off. Signed-off-by: Carmelo Amoroso CC: Khem Ray --- libc/sysdeps/linux/common/sysdep.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/sysdep.h b/libc/sysdeps/linux/common/sysdep.h index a7ec95480..156e5711a 100644 --- a/libc/sysdeps/linux/common/sysdep.h +++ b/libc/sysdeps/linux/common/sysdep.h @@ -51,6 +51,7 @@ /* Macros to generate eh_frame unwind information. */ # ifdef HAVE_ASM_CFI_DIRECTIVES +# define cfi_sections(sect...) .cfi_sections sect # define cfi_startproc .cfi_startproc # define cfi_endproc .cfi_endproc # define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off @@ -71,6 +72,7 @@ # define cfi_lsda(enc, exp) .cfi_lsda enc, exp # else +# define cfi_sections(sect...) # define cfi_startproc # define cfi_endproc # define cfi_def_cfa(reg, off) @@ -95,6 +97,8 @@ # ifdef HAVE_ASM_CFI_DIRECTIVES # define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name) # define CFI_STRINGIFY2(Name) #Name +# define CFI_SECTIONS(sect...) \ + ".cfi_sections " CFI_STRINGIFY(sect) # define CFI_STARTPROC ".cfi_startproc" # define CFI_ENDPROC ".cfi_endproc" # define CFI_DEF_CFA(reg, off) \ @@ -128,6 +132,7 @@ # define CFI_LSDA(enc, exp) \ ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp) # else +# define CFI_SECTIONS(sect...) # define CFI_STARTPROC # define CFI_ENDPROC # define CFI_DEF_CFA(reg, off) -- cgit v1.2.3 From 380b5c5b31bdbf5e171ce035009e5e53b0ea230d Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:33:21 +0100 Subject: use common sigthread.h NPTL build did not use the correct bits/sigthread.h, use a common version avoiding this. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/sigthread.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/sigthread.h b/libc/sysdeps/linux/common/bits/sigthread.h index 960bde18a..4f14b9f45 100644 --- a/libc/sysdeps/linux/common/bits/sigthread.h +++ b/libc/sysdeps/linux/common/bits/sigthread.h @@ -1,5 +1,5 @@ /* Signal handling function for threaded programs. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2002, 2009 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 @@ -35,4 +35,10 @@ extern int pthread_sigmask (int __how, /* Send signal SIGNO to the given thread. */ extern int pthread_kill (pthread_t __threadid, int __signo) __THROW; +#if defined __USE_GNU && defined __UCLIBC_HAS_THREADS_NATIVE__ +/* Queue signal and data to a thread. */ +extern int pthread_sigqueue (pthread_t __threadid, int __signo, + const union sigval __value) __THROW; +#endif + #endif /* bits/sigthread.h */ -- cgit v1.2.3 From f00e553e4b084007781df5e4b5accc2e152da231 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 19:41:29 +0100 Subject: add missing prototypes Add some missing prototypes Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/longjmp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index 4d1442414..b07eced6a 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -24,6 +24,10 @@ extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn; libc_hidden_proto(__longjmp) +#if 0 +extern void _longjmp_unwind (jmp_buf env, int val); +#endif + extern __typeof(longjmp) __libc_longjmp attribute_noreturn; /* Set the signal mask to the one specified in ENV, and jump to the position specified in ENV, causing the setjmp -- cgit v1.2.3 From 2e9d2266c0cea250f7a87dc6aa2b02d0bd5a0aea Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 26 Feb 2011 21:49:38 +0100 Subject: Correct ssp code Avoid using strong_alias in ssp, some archs dislike it. Make stack_chk_guard static. Export __stack_smash_handler only if compatibility option is enabled. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/ssp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index a2d7ff2ca..d81c706f4 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -71,6 +71,7 @@ static attribute_noreturn void terminate(void) _exit(127); } +#ifdef __UCLIBC_HAS_SSP_COMPAT__ void __stack_smash_handler(char func[], int damaged __attribute__ ((unused))) attribute_noreturn __cold; void __stack_smash_handler(char func[], int damaged) { @@ -84,6 +85,7 @@ void __stack_smash_handler(char func[], int damaged) while(1) terminate(); } +#endif void __stack_chk_fail(void) attribute_noreturn __cold; void __stack_chk_fail(void) @@ -114,4 +116,3 @@ void __chk_fail(void) while(1) terminate(); } - -- cgit v1.2.3 From 5ecbf1730329be5e04229fb1ea23f4bc0bc3d2a3 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sun, 27 Feb 2011 00:20:58 +0100 Subject: fix stubs We use enosys_stub only in this file so make it static Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/stubs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index dd4a384f8..8688e98a1 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -11,15 +11,11 @@ #ifdef __UCLIBC_HAS_STUBS__ -attribute_hidden int enosys_stub(void); -libc_hidden_proto(enosys_stub) - -attribute_hidden int enosys_stub(void) +static int enosys_stub(void) { __set_errno(ENOSYS); return -1; } -libc_hidden_def(enosys_stub) #define make_stub(stub) \ link_warning(stub, #stub ": this function is not implemented") \ -- cgit v1.2.3 From 83c1854b97d79e2b67065b1a2651b0d11d8a8f6b Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 2 Mar 2011 15:06:51 +0100 Subject: remove error handling from some syscalls Remove error handling from getegid/getgid/geteuid/getuid/getppid/getpid/getpgrp Use strong_alias if fallbacks are needed Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/syscalls-common.h | 1 + libc/sysdeps/linux/common/getegid.c | 22 +++++----------------- libc/sysdeps/linux/common/geteuid.c | 21 ++++----------------- libc/sysdeps/linux/common/getgid.c | 8 ++++++-- libc/sysdeps/linux/common/getpgrp.c | 2 +- libc/sysdeps/linux/common/getpid.c | 12 +++++++----- libc/sysdeps/linux/common/getppid.c | 8 ++------ libc/sysdeps/linux/common/getuid.c | 8 ++++++-- libc/sysdeps/linux/common/umask.c | 2 +- 9 files changed, 33 insertions(+), 51 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h index 5e4e350c5..1b84d9e2b 100644 --- a/libc/sysdeps/linux/common/bits/syscalls-common.h +++ b/libc/sysdeps/linux/common/bits/syscalls-common.h @@ -97,6 +97,7 @@ type name(C_DECL_ARGS_##nargs(args)) { \ } #define _syscall0(args...) SYSCALL_FUNC(0, args) +#define _syscall_noerr0(args...) SYSCALL_NOERR_FUNC(0, args) #define _syscall1(args...) SYSCALL_FUNC(1, args) #define _syscall_noerr1(args...) SYSCALL_NOERR_FUNC(1, args) #define _syscall2(args...) SYSCALL_FUNC(2, args) diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c index f2b6401cf..80a8ac9bb 100644 --- a/libc/sysdeps/linux/common/getegid.c +++ b/libc/sysdeps/linux/common/getegid.c @@ -10,24 +10,12 @@ #include #include - -#if defined(__NR_getegid32) +#ifdef __NR_getegid32 # undef __NR_getegid # define __NR_getegid __NR_getegid32 -_syscall0(gid_t, getegid) - -#elif defined(__NR_getegid) -# define __NR___syscall_getegid __NR_getegid -static __inline__ _syscall0(int, __syscall_getegid) -gid_t getegid(void) -{ - return (__syscall_getegid()); -} -#else - -gid_t getegid(void) -{ - return (getgid()); -} #endif + +#ifdef __NR_getegid +_syscall_noerr0(gid_t, getegid) libc_hidden_def(getegid) +#endif diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c index 6111e5d1b..610fbc170 100644 --- a/libc/sysdeps/linux/common/geteuid.c +++ b/libc/sysdeps/linux/common/geteuid.c @@ -10,25 +10,12 @@ #include #include - -#if defined(__NR_geteuid32) +#ifdef __NR_geteuid32 # undef __NR_geteuid # define __NR_geteuid __NR_geteuid32 -_syscall0(uid_t, geteuid) - -#elif defined(__NR_geteuid) -# define __NR___syscall_geteuid __NR_geteuid -static __inline__ _syscall0(int, __syscall_geteuid) -uid_t geteuid(void) -{ - return (__syscall_geteuid()); -} - -#else -uid_t geteuid(void) -{ - return (getuid()); -} #endif +#ifdef __NR_geteuid +_syscall_noerr0(uid_t, geteuid) libc_hidden_def(geteuid) +#endif diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c index 80c60034e..ccfbfc067 100644 --- a/libc/sysdeps/linux/common/getgid.c +++ b/libc/sysdeps/linux/common/getgid.c @@ -10,7 +10,7 @@ #include #include -#if defined __NR_getxgid +#ifdef __NR_getxgid # undef __NR_getgid # define __NR_getgid __NR_getxgid #endif @@ -19,5 +19,9 @@ # define __NR_getgid __NR_getgid32 #endif -_syscall0(gid_t, getgid) +_syscall_noerr0(gid_t, getgid) libc_hidden_def(getgid) +#if !defined __NR_getegid32 && !defined __NR_getegid +strong_alias(getgid,getegid) +libc_hidden_def(getegid) +#endif diff --git a/libc/sysdeps/linux/common/getpgrp.c b/libc/sysdeps/linux/common/getpgrp.c index 80a53daee..0af9dc499 100644 --- a/libc/sysdeps/linux/common/getpgrp.c +++ b/libc/sysdeps/linux/common/getpgrp.c @@ -12,7 +12,7 @@ #ifdef __NR_getpgrp /* According to the manpage the POSIX.1 version is favoured */ -_syscall0(pid_t, getpgrp) +_syscall_noerr0(pid_t, getpgrp) #elif defined __NR_getpgid && (defined __NR_getpid || defined __NR_getxpid) /* IA64 doesn't have a getpgrp syscall */ pid_t getpgrp(void) diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c index 8041022e7..d9a69084f 100644 --- a/libc/sysdeps/linux/common/getpid.c +++ b/libc/sysdeps/linux/common/getpid.c @@ -10,11 +10,13 @@ #include #include -extern __typeof(getpid) __libc_getpid; -#if defined __NR_getxpid +#ifdef __NR_getxpid +# undef __NR_getpid # define __NR_getpid __NR_getxpid #endif -#define __NR___libc_getpid __NR_getpid -_syscall0(pid_t, __libc_getpid) -weak_alias(__libc_getpid, getpid) + +_syscall_noerr0(pid_t, getpid) libc_hidden_weak(getpid) +#ifndef __NR_getppid +strong_alias(getpid,getppid) +#endif diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/getppid.c index 4f2b0e933..9d85661d9 100644 --- a/libc/sysdeps/linux/common/getppid.c +++ b/libc/sysdeps/linux/common/getppid.c @@ -9,11 +9,7 @@ #include #include + #ifdef __NR_getppid -_syscall0(pid_t, getppid) -#else -pid_t getppid(void) -{ - return getpid(); -} +_syscall_noerr0(pid_t, getppid) #endif diff --git a/libc/sysdeps/linux/common/getuid.c b/libc/sysdeps/linux/common/getuid.c index b6f813a06..f921acb2e 100644 --- a/libc/sysdeps/linux/common/getuid.c +++ b/libc/sysdeps/linux/common/getuid.c @@ -10,7 +10,7 @@ #include #include -#if defined __NR_getxuid +#ifdef __NR_getxuid # undef __NR_getuid # define __NR_getuid __NR_getxuid #endif @@ -19,5 +19,9 @@ # define __NR_getuid __NR_getuid32 #endif -_syscall0(uid_t, getuid) +_syscall_noerr0(uid_t, getuid) libc_hidden_def(getuid) +#if !defined __NR_geteuid32 && !defined __NR_geteuid +strong_alias(getuid,geteuid) +libc_hidden_def(geteuid) +#endif diff --git a/libc/sysdeps/linux/common/umask.c b/libc/sysdeps/linux/common/umask.c index ef9860e31..b838e1731 100644 --- a/libc/sysdeps/linux/common/umask.c +++ b/libc/sysdeps/linux/common/umask.c @@ -15,5 +15,5 @@ static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, m mode_t umask(mode_t mode) { - return (__syscall_umask(mode)); + return __syscall_umask(mode); } -- cgit v1.2.3 From 5e22e71adfef5ad46119cea98fccf4ae998ad0d8 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 2 Mar 2011 21:59:58 +0100 Subject: remove ucontext.h and guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS Remove ucontext.h if SUSV4_LEGACY is not set and fix it's references. Guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS. Disable sigstack function prototype, it is not provided by uClibc. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/sigstack.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/sigstack.h b/libc/sysdeps/linux/common/bits/sigstack.h index 7f260367b..2b3b321bd 100644 --- a/libc/sysdeps/linux/common/bits/sigstack.h +++ b/libc/sysdeps/linux/common/bits/sigstack.h @@ -22,12 +22,14 @@ #endif +#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__ /* Structure describing a signal stack (obsolete). */ struct sigstack { void *ss_sp; /* Signal stack pointer. */ int ss_onstack; /* Nonzero if executing on this stack. */ }; +#endif /* Possible values for `ss_flags.'. */ -- cgit v1.2.3 From ca8f0d9cf39e60851e17f0c6dd5f3e4f51b64f5b Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 2 Mar 2011 22:30:10 +0100 Subject: simplify guard of uClibc internals Simplify guard of uClibc internals, since _LIBC sections are removed on install. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/uClibc_ctype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/libc/sysdeps/linux/common/bits/uClibc_ctype.h index 3bf4e1b28..5ff281d8e 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_ctype.h +++ b/libc/sysdeps/linux/common/bits/uClibc_ctype.h @@ -95,7 +95,7 @@ /**********************************************************************/ __BEGIN_DECLS -#if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc) +#ifdef _LIBC /* These are uClibc-specific. */ # define __isdigit_char(c) ((unsigned char)((c) - '0') <= 9) # define __isdigit_int(c) ((unsigned int)((c) - '0') <= 9) -- cgit v1.2.3 From 96c9a8f7d00cdf6bb7968a2390b9d87da8a45e2d Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 3 Mar 2011 15:06:47 +0100 Subject: add _dl_errno support to errno.h, cleanup Add support to use errno.h in ldso. Move __set_errno into _LIBC guard. Remove uClibc_errno.h, unused. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/uClibc_errno.h | 43 --------------------------- 1 file changed, 43 deletions(-) delete mode 100644 libc/sysdeps/linux/common/bits/uClibc_errno.h (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/uClibc_errno.h b/libc/sysdeps/linux/common/bits/uClibc_errno.h deleted file mode 100644 index 9c1561841..000000000 --- a/libc/sysdeps/linux/common/bits/uClibc_errno.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2000-2006 Erik Andersen - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ -#ifndef _BITS_UCLIBC_ERRNO_H -#define _BITS_UCLIBC_ERRNO_H 1 - -#ifdef IS_IN_rtld -# undef errno -# define errno _dl_errno -extern int _dl_errno; /* attribute_hidden; */ -#elif defined __UCLIBC_HAS_THREADS__ -# include -# if defined USE___THREAD && USE___THREAD -# undef errno -# ifndef NOT_IN_libc -# define errno __libc_errno -# else -# define errno errno -# endif -extern __thread int errno attribute_tls_model_ie; -# endif /* USE___THREAD */ -#endif /* IS_IN_rtld */ - -#define __set_errno(val) (errno = (val)) - -#ifndef __ASSEMBLER__ -extern int *__errno_location (void) __THROW __attribute__ ((__const__)) -# ifdef IS_IN_rtld - attribute_hidden -# endif -; -# if defined __UCLIBC_HAS_THREADS__ -# include -# if defined USE___THREAD && USE___THREAD -libc_hidden_proto(__errno_location) -# endif -# endif - -#endif /* !__ASSEMBLER__ */ - -#endif -- cgit v1.2.3 From 5ebef433698a13e5171f4b7dca04f2006bd92468 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 3 Mar 2011 16:04:03 +0100 Subject: provide internal hidden version of __fcntl_nocancel guard the prototype with _LIBC, it is only for internal use Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/__syscall_fcntl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c index 5da3c5f32..6d4c339ab 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl.c @@ -40,6 +40,7 @@ int __fcntl_nocancel (int fd, int cmd, ...) # endif return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg); } +libc_hidden_def(__fcntl_nocancel) int __libc_fcntl (int fd, int cmd, ...) { -- cgit v1.2.3 From 46d6a24872b7fa2717f8f71b5e0598a14d38e1f6 Mon Sep 17 00:00:00 2001 From: Aurelien Jacquiot Date: Wed, 23 Feb 2011 13:04:59 +0100 Subject: The C6X port This adds support for the TI C6X family of processors. Signed-off-by: Mark Salter Signed-off-by: Aurelien Jacquiot Signed-off-by: Bernd Schmidt --- libc/sysdeps/linux/common/Makefile.in | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 302fa6450..fd55333fc 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -50,6 +50,7 @@ CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c CSRC-$(UCLIBC_HAS_XATTR) += xattr.c CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c +CSRC- += $(if $(findstring =c6x=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),longjmp.c vfork.c) CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c) -- cgit v1.2.3 From 82098ab9b853c33ee8ade61c9510b295cc696de1 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 9 Mar 2011 09:23:48 +0100 Subject: guard *_chk() related stuff with UCLIBC_HAS_FORTIFY Guard x86_64 memset_chk/memcpy_chk be guarded by UCLIBC_HAS_FORTIFY. Compile ssp.c if one of SSP/FORTIFY is defined. Guard __chk_fail() with UCLIBC_HAS_FORTIFY and move its prototype to libc-internal.h. Disable _FORTIFY_SOURCE if UCLIBC_HAS_FORTIFY is not set. The config option itself is omitted on purpose, headers need to be reviewed and generic *_chk() functions need to be first provided. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/Makefile.in | 2 +- libc/sysdeps/linux/common/ssp.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index fd55333fc..3f9791104 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -15,7 +15,7 @@ CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c)) CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y)) CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS) -CSRC-$(UCLIBC_HAS_SSP) += ssp.c +CSRC-$(if $(or $(UCLIBC_HAS_SSP),$(UCLIBC_HAS_FORTIFY)),y) += ssp.c CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \ get_kernel_syms.c # we need these internally: fstatfs.c statfs.c diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index d81c706f4..df242cc69 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -87,6 +87,7 @@ void __stack_smash_handler(char func[], int damaged) } #endif +#ifdef __UCLIBC_HAS_SSP__ void __stack_chk_fail(void) attribute_noreturn __cold; void __stack_chk_fail(void) { @@ -101,8 +102,9 @@ void __stack_chk_fail(void) while(1) terminate(); } +#endif -void __chk_fail(void) attribute_noreturn; +#ifdef __UCLIBC_HAS_FORTIFY__ void __chk_fail(void) { static const char msg1[] = "buffer overflow detected: "; @@ -116,3 +118,5 @@ void __chk_fail(void) while(1) terminate(); } +libc_hidden_def(__chk_fail) +#endif -- cgit v1.2.3 From 117fbd4310fa600d0449d4268b4e6ee833471e1a Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 9 Mar 2011 09:54:15 +0100 Subject: types.h: remove __ipc_pid_t Remove __ipc_pid_t, not needed internally, we do not support pre glibc-2.2 version of shmid_ds structure. Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/types.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/types.h b/libc/sysdeps/linux/common/bits/types.h index 24d0056fb..c4c10e2ff 100644 --- a/libc/sysdeps/linux/common/bits/types.h +++ b/libc/sysdeps/linux/common/bits/types.h @@ -200,11 +200,6 @@ __STD_TYPE __U32_TYPE __socklen_t; #undef __STD_TYPE -#ifdef _LIBC -/* Used in `struct shmid_ds'. */ -typedef __kernel_ipc_pid_t __ipc_pid_t; -#endif - /* Now add the thread types. */ #if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98) # include -- cgit v1.2.3 From 92895c04f3033834ee512942014a9e643ba579a5 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 9 Mar 2011 13:10:41 +0100 Subject: bits/statvfs.h: update, adding ST_RELATIME Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/bits/statvfs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/bits/statvfs.h b/libc/sysdeps/linux/common/bits/statvfs.h index cca0871ac..84717c3d9 100644 --- a/libc/sysdeps/linux/common/bits/statvfs.h +++ b/libc/sysdeps/linux/common/bits/statvfs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2001,2002,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 @@ -101,7 +101,9 @@ enum # define ST_IMMUTABLE ST_IMMUTABLE ST_NOATIME = 1024, /* Do not update access times. */ # define ST_NOATIME ST_NOATIME - ST_NODIRATIME = 2048 /* Do not update directory access times. */ + ST_NODIRATIME = 2048, /* Do not update directory access times. */ # define ST_NODIRATIME ST_NODIRATIME + ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */ +# define ST_RELATIME ST_RELATIME #endif /* Use GNU. */ }; -- cgit v1.2.3 From 1dd9275091d6cbb14d6b149770fc90cef53577cf Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Wed, 9 Mar 2011 13:32:30 +0100 Subject: remove trailing ';' from _syscallX() Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/sigsuspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/sigsuspend.c b/libc/sysdeps/linux/common/sigsuspend.c index 789eeda89..ded2aad5b 100644 --- a/libc/sysdeps/linux/common/sigsuspend.c +++ b/libc/sysdeps/linux/common/sigsuspend.c @@ -38,7 +38,7 @@ int sigsuspend (const sigset_t *set) return result; } # else -static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size); +static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size) int sigsuspend(const sigset_t * mask) { -- cgit v1.2.3 From fcde46eae5c16948c71f71d0b8fb82019f60f51f Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 10 Mar 2011 11:33:51 +0100 Subject: nanosleep.c: remove duplicated libc_hidden_proto Signed-off-by: Peter S. Mazinger --- libc/sysdeps/linux/common/nanosleep.c | 1 - 1 file changed, 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/nanosleep.c b/libc/sysdeps/linux/common/nanosleep.c index 0be59c511..26ce4a6c5 100644 --- a/libc/sysdeps/linux/common/nanosleep.c +++ b/libc/sysdeps/linux/common/nanosleep.c @@ -36,6 +36,5 @@ int __libc_nanosleep(const struct timespec *req, struct timespec *rem) #endif } -libc_hidden_proto(nanosleep) weak_alias(__libc_nanosleep,nanosleep) libc_hidden_weak(nanosleep) -- cgit v1.2.3 From 251f2266bf24b1b396f59eef60d0acf41fdd02e4 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 18 Mar 2011 15:37:35 +0100 Subject: lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined while there, provide stubs for functions depending on utimensat syscall. Reported-by: Sedat Dilek Signed-off-by: Peter S. Mazinger Signed-off-by: Khem Raj --- libc/sysdeps/linux/common/lutimes.c | 2 +- libc/sysdeps/linux/common/stubs.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/lutimes.c b/libc/sysdeps/linux/common/lutimes.c index 0b4a8ea45..e01d40efd 100644 --- a/libc/sysdeps/linux/common/lutimes.c +++ b/libc/sysdeps/linux/common/lutimes.c @@ -12,7 +12,7 @@ #ifdef __NR_lutimes _syscall2(int, lutimes, const char *, file, const struct timeval *, tvp) -#else +#elif defined __NR_utimensat #include #include diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index 8688e98a1..655c64001 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -172,6 +172,14 @@ make_stub(umount) make_stub(umount2) #endif +#ifndef __NR_utimensat +make_stub(futimens) +make_stub(utimensat) +# ifndef __NR_lutimes +make_stub(lutimes) +# endif +#endif + #ifndef __NR_vmsplice make_stub(vmsplice) #endif -- cgit v1.2.3