Ignore:
Timestamp:
May 22, 2019, 4:09:18 PM (5 years ago)
Author:
coas-nagasima
Message:

ファイルディスクリプタ処理を更新

Location:
asp3_tinet_ecnl_rx/trunk/musl-1.1.18
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/bits/alltypes.h

    r374 r387  
    1 #if defined(_MSC_VER) || defined(__c2__)
    2 #define asctime musl_asctime
    3 #define calloc musl_calloc
    4 #define clock musl_clock
    5 #define close musl_close
    6 #define execvp musl_execvp
    7 #define exit musl_exit
    8 #define fclose musl_fclose
    9 #define fdopen musl_fdopen
    10 #define fflush musl_fflush
    11 #define fma _musl_fma
    12 #define fgetc musl_fgetc
    13 #define fopen musl_fopen
    14 #define fprintf musl_fprintf
    15 #define fputc musl_fputc
    16 #define free musl_free
    17 #define fwrite musl_fwrite
    18 #define getcwd musl_getcwd
    19 #define localtime musl_localtime
    20 #define lseek musl_lseek
    21 #define malloc musl_malloc
    22 #define memmove musl_memmove
    23 #define open musl_open
    24 #define perror musl_perror
    25 #define printf musl_printf
    26 #define read musl_read
    27 #define realloc musl_realloc
    28 #define strftime musl_strftime
    29 #define strnlen musl_strnlen
    30 #define strtoul musl_strtoul
    31 #define time musl_time
    32 #define tzset musl_tzset
    33 #define unlink musl_unlink
    34 #define strncmp musl_strncmp
    35 #define strtol musl_strtol
    36 #define strchr musl_strchr
    37 #endif
    381#ifdef _MSC_VER
    392#define __builtin_va_list char *
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/math.h

    r364 r387  
    1515#define NAN       __builtin_nanf("")
    1616#define INFINITY  __builtin_inff()
    17 #elif !defined(_MSC_VER)
     17#else
    1818#define NAN       (0.0f/0.0f)
    1919#define INFINITY  1e5000f
    20 #else
    21 #define _HUGE_ENUF  1e+300
    22 #define INFINITY   ((float)(_HUGE_ENUF * _HUGE_ENUF))
    23 #define NAN        ((float)(INFINITY * 0.0F))
    2420#endif
    2521
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/include/stddef.h

    r337 r387  
    1111#define __NEED_size_t
    1212#define __NEED_wchar_t
    13 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
     13#if __STDC_VERSION__ >= 201112L || (defined(__cplusplus) && __cplusplus >= 201103L)
    1414#define __NEED_max_align_t
    1515#endif
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/locale/__lctrans.c

    r337 r387  
    88}
    99
    10 #ifndef __c2__
    1110weak_alias(dummy, __lctrans_impl);
    12 #endif
    1311
    1412const char *__lctrans(const char *msg, const struct __locale_map *lm)
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/locale/__mo_lookup.c

    r337 r387  
    44static inline uint32_t swapc(uint32_t x, int c)
    55{
    6         return c ? x>>24 | x>>8&0xff00 | x<<8&0xff0000 | x<<24 : x;
     6        return c ? (x>>24) | (x>>8&0xff00) | (x<<8&0xff0000) | (x<<24) : x;
    77}
    88
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/locale/iconv.c

    r337 r387  
    136136{
    137137        e &= 3;
    138         return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
     138        return (s[e]+0U)<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
    139139}
    140140
     
    156156        unsigned x = c - 128 - map[-1];
    157157        x = legacy_chars[ map[x*5/4]>>2*x%8 |
    158                 map[x*5/4+1]<<8-2*x%8 & 1023 ];
     158                (map[x*5/4+1]<<(8-2*x%8) & 1023) ];
    159159        return x ? x : c;
    160160}
     
    348348                                c += (0xa1-0x81);
    349349                                d += 0xa1;
    350                                 if (c >= 93 || c>=0xc6-0x81 && d>0x52)
     350                                if (c >= 93 || (c>=0xc6-0x81 && d>0x52))
    351351                                        goto ilseq;
    352352                                if (d-'A'<26) d = d-'A';
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/locale/locale_map.c

    r337 r387  
    3636
    3737        if (!*val) {
    38                 (val = getenv("LC_ALL")) && *val ||
    39                 (val = getenv(envvars[cat])) && *val ||
    40                 (val = getenv("LANG")) && *val ||
     38                ((val = getenv("LC_ALL")) && *val) ||
     39                ((val = getenv(envvars[cat])) && *val) ||
     40                ((val = getenv("LANG")) && *val) ||
    4141                (val = "C.UTF-8");
    4242        }
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/malloc/memalign.c

    r337 r387  
    4646        footer = ((size_t *)end)[-2];
    4747
    48         ((size_t *)mem)[-1] = header&7 | new-mem;
    49         ((size_t *)new)[-2] = footer&7 | new-mem;
    50         ((size_t *)new)[-1] = header&7 | end-new;
    51         ((size_t *)end)[-2] = footer&7 | end-new;
     48        ((size_t *)mem)[-1] = (header&7) | new-mem;
     49        ((size_t *)new)[-2] = (footer&7) | new-mem;
     50        ((size_t *)new)[-1] = (header&7) | end-new;
     51        ((size_t *)end)[-2] = (footer&7) | end-new;
    5252
    5353        free(mem);
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/math/fma.c

    r337 r387  
    7070                if (d < 64) {
    7171                        zlo = nz.m<<d;
    72                         zhi = nz.m>>64-d;
     72                        zhi = nz.m>>(64-d);
    7373                } else {
    7474                        zlo = 0;
     
    7878                        if (d == 0) {
    7979                        } else if (d < 64) {
    80                                 rlo = rhi<<64-d | rlo>>d | !!(rlo<<64-d);
     80                                rlo = rhi<<(64-d) | rlo>>d | !!(rlo<<(64-d));
    8181                                rhi = rhi>>d;
    8282                        } else {
     
    9191                        zlo = nz.m;
    9292                } else if (d < 64) {
    93                         zlo = nz.m>>d | !!(nz.m<<64-d);
     93                        zlo = nz.m>>d | !!(nz.m<<(64-d));
    9494                } else {
    9595                        zlo = 1;
     
    123123                d = a_clz_64(rhi)-1;
    124124                /* note: d > 0 */
    125                 rhi = rhi<<d | rlo>>64-d | !!(rlo<<d);
     125                rhi = rhi<<d | rlo>>(64-d) | !!(rlo<<d);
    126126        } else if (rlo) {
    127127                d = a_clz_64(rlo)-1;
     
    174174                        /* only round once when scaled */
    175175                        d = 10;
    176                         i = ( rhi>>d | !!(rhi<<64-d) ) << d;
     176                        i = ( rhi>>d | !!(rhi<<(64-d)) ) << d;
    177177                        if (sign)
    178178                                i = -i;
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/network/lookup_name.c

    r337 r387  
    1111#include <pthread.h>
    1212#include <errno.h>
     13#include <resolv.h>
    1314#include "lookup.h"
    1415#include "stdio_impl.h"
     
    185186        if (dots >= conf.ndots || name[l-1]=='.') *search = 0;
    186187
     188        /* Strip final dot for canon, fail if multiple trailing dots. */
     189        if (name[l-1]=='.') l--;
     190        if (!l || name[l-1]=='.') return EAI_NONAME;
     191
    187192        /* This can never happen; the caller already checked length. */
    188193        if (l >= 256) return EAI_NONAME;
     
    311316        if (!cnt && !(flags & AI_NUMERICHOST)) {
    312317                cnt = name_from_hosts(buf, canon, name, family);
    313                 if (!cnt) cnt = name_from_dns_search(buf, canon, name, family);
     318                if (cnt<=0) cnt = name_from_dns_search(buf, canon, name, family);
    314319        }
    315320        if (cnt<=0) return cnt ? cnt : EAI_NONAME;
     
    352357         * So far the label/precedence table cannot be customized. */
    353358        for (i=0; i<cnt; i++) {
     359                int family = buf[i].family;
    354360                int key = 0;
    355                 struct sockaddr_in6 sa, da = {
     361                struct sockaddr_in6 sa6 = { 0 }, da6 = {
    356362                        .sin6_family = AF_INET6,
    357363                        .sin6_scope_id = buf[i].scopeid,
    358364                        .sin6_port = 65535
    359365                };
    360                 if (buf[i].family == AF_INET6) {
    361                         memcpy(da.sin6_addr.s6_addr, buf[i].addr, 16);
     366                struct sockaddr_in sa4 = { 0 }, da4 = {
     367                        .sin_family = AF_INET,
     368                        .sin_port = 65535
     369                };
     370                void *sa, *da;
     371                socklen_t salen, dalen;
     372                if (family == AF_INET6) {
     373                        memcpy(da6.sin6_addr.s6_addr, buf[i].addr, 16);
     374                        da = &da6; dalen = sizeof da6;
     375                        sa = &sa6; salen = sizeof sa6;
    362376                } else {
    363                         memcpy(da.sin6_addr.s6_addr,
     377                        memcpy(sa6.sin6_addr.s6_addr,
    364378                                "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
    365                         memcpy(da.sin6_addr.s6_addr+12, buf[i].addr, 4);
    366                 }
    367                 const struct policy *dpolicy = policyof(&da.sin6_addr);
    368                 int dscope = scopeof(&da.sin6_addr);
     379                        memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
     380                        memcpy(da6.sin6_addr.s6_addr,
     381                                "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
     382                        memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
     383                        memcpy(&da4.sin_addr, buf[i].addr, 4);
     384                        da = &da4; dalen = sizeof da4;
     385                        sa = &sa4; salen = sizeof sa4;
     386                }
     387                const struct policy *dpolicy = policyof(&da6.sin6_addr);
     388                int dscope = scopeof(&da6.sin6_addr);
    369389                int dlabel = dpolicy->label;
    370390                int dprec = dpolicy->prec;
    371391                int prefixlen = 0;
    372                 int fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
     392                int fd = socket(family, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
    373393                if (fd >= 0) {
    374                         if (!connect(fd, (void *)&da, sizeof da)) {
     394                        if (!connect(fd, da, dalen)) {
    375395                                key |= DAS_USABLE;
    376                                 if (!getsockname(fd, (void *)&sa,
    377                                     &(socklen_t){sizeof sa})) {
    378                                         if (dscope == scopeof(&sa.sin6_addr))
     396                                if (!getsockname(fd, sa, &salen)) {
     397                                        if (family == AF_INET) memcpy(
     398                                                sa6.sin6_addr.s6_addr+12,
     399                                                &sa4.sin_addr, 4);
     400                                        if (dscope == scopeof(&sa6.sin6_addr))
    379401                                                key |= DAS_MATCHINGSCOPE;
    380                                         if (dlabel == labelof(&sa.sin6_addr))
     402                                        if (dlabel == labelof(&sa6.sin6_addr))
    381403                                                key |= DAS_MATCHINGLABEL;
    382                                         prefixlen = prefixmatch(&sa.sin6_addr,
    383                                                 &da.sin6_addr);
     404                                        prefixlen = prefixmatch(&sa6.sin6_addr,
     405                                                &da6.sin6_addr);
    384406                                }
    385407                        }
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/process/vfork.c

    r374 r387  
    1515}
    1616
    17 #ifndef __c2__
    1817weak_alias(__vfork, vfork);
    19 #else
    20 pid_t vfork(void)
    21 {
    22         return __vfork();
    23 }
    24 #endif
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/signal/sigaction.c

    r374 r387  
    6161}
    6262
    63 #ifndef __c2__
    6463weak_alias(__sigaction, sigaction);
    65 #else
    66 int sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old)
    67 {
    68         return __sigaction(sig, sa, old);
    69 }
    70 #endif
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/stdio/__stdio_write.c

    r337 r387  
    3232                iov[0].iov_len -= cnt;
    3333        }
     34        return -1;
    3435}
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/stdlib/strtol.c

    r374 r387  
    5757}
    5858
    59 #if defined(_MSC_VER) || defined(__c2__)
    60 weak_alias(musl_strtol, __strtol_internal);
    61 weak_alias(musl_strtoul, __strtoul_internal);
    62 #else
    6359weak_alias(strtol, __strtol_internal);
    6460weak_alias(strtoul, __strtoul_internal);
    65 #endif
    6661weak_alias(strtoll, __strtoll_internal);
    6762weak_alias(strtoull, __strtoull_internal);
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/string/memrchr.c

    r374 r387  
    1010}
    1111
    12 #ifndef __c2__
    1312weak_alias(__memrchr, memrchr);
    14 #else
    15 void *memrchr(const void *m, int c, size_t n)
    16 {
    17         return __memrchr(m, c, n);
    18 }
    19 #endif
  • asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/string/strchrnul.c

    r374 r387  
    2424}
    2525
    26 #ifndef __c2__
    2726weak_alias(__strchrnul, strchrnul);
    28 #else
    29 char *strchrnul(const char *s, int c)
    30 {
    31         return __strchrnul(s, c);
    32 }
    33 #endif
Note: See TracChangeset for help on using the changeset viewer.