diff options
Diffstat (limited to 'libc')
112 files changed, 4949 insertions, 865 deletions
diff --git a/libc/Makefile.in b/libc/Makefile.in index 323c4e463..ff3e5c31d 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -16,7 +16,9 @@ VERSION_SCRIPT := -Wl,--version-script,$(VERSION_SCRIPT) endif LDFLAGS-libc.so := $(LDFLAGS) $(VERSION_SCRIPT) -Wl,-init,$(SYMBOL_PREFIX)__uClibc_init - +ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y) +CFLAGS += -D__USE_STDIO_FUTEXES__ +endif LIBS-libc.so := $(interp) $(ldso) $(top_builddir)lib/$(NONSHARED_LIBNAME) # we have SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION) defined in Rules.mak diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index b91486f53..8c7f7b9f1 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -56,6 +56,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <assert.h> #include <errno.h> #include <netdb.h> +#include <tls.h> #include <resolv.h> #include <stdio.h> #include <stdlib.h> @@ -307,7 +308,7 @@ gaih_local(const char *name, const struct gaih_service *service, char *buf = ((struct sockaddr_un *)ai->ai_addr)->sun_path; if (__path_search(buf, L_tmpnam, NULL, NULL, 0) != 0 - || __gen_tempname(buf, __GT_NOCREATE) != 0 + || __gen_tempname(buf, __GT_NOCREATE, 0) != 0 ) { return -EAI_SYSTEM; } diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c index ac4c56c35..90b22ae7a 100644 --- a/libc/inet/hostid.c +++ b/libc/inet/hostid.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <string.h> #include <netdb.h> +#include <not-cancel.h> #define HOSTID "/etc/hostid" @@ -25,11 +26,11 @@ int sethostid(long int new_id) if (geteuid() || getuid()) return __set_errno(EPERM); - fd = open(HOSTID, O_CREAT|O_WRONLY, 0644); + fd = open_not_cancel(HOSTID, O_CREAT|O_WRONLY, 0644); if (fd < 0) return fd; - ret = write(fd, &new_id, sizeof(new_id)) == sizeof(new_id) ? 0 : -1; - close(fd); + ret = write_not_cancel(fd, &new_id, sizeof(new_id)) == sizeof(new_id) ? 0 : -1; + close_not_cancel_no_status (fd); return ret; } #endif @@ -44,10 +45,10 @@ long int gethostid(void) * It is not an error if we cannot read this file. It is not even an * error if we cannot read all the bytes, we just carry on trying... */ - fd = open(HOSTID, O_RDONLY); + fd = open_not_cancel_2(HOSTID, O_RDONLY); if (fd >= 0) { - int i = read(fd, &id, sizeof(id)); - close(fd); + int i = read_not_cancel(fd, &id, sizeof(id)); + close_not_cancel_no_status(fd); if (i > 0) return id; } diff --git a/libc/inet/if_index.c b/libc/inet/if_index.c index 750a4649e..8efcd2a76 100644 --- a/libc/inet/if_index.c +++ b/libc/inet/if_index.c @@ -32,6 +32,7 @@ #include <sys/socket.h> #include <sys/ioctl.h> #include <libc-internal.h> +#include <not-cancel.h> #include "netlinkaccess.h" @@ -55,13 +56,13 @@ if_nametoindex(const char* ifname) { /* close never fails here, fd is just a unconnected socket. *int saved_errno = errno; */ - close(fd); + close_not_cancel_no_status(fd); /*if (saved_errno == EINVAL) * __set_errno(ENOSYS); */ return 0; } - close(fd); + close_not_cancel_no_status(fd); return ifr.ifr_ifindex; #endif |