Merge remote-tracking branch 'nsz/math'
authorRich Felker <dalias@aerifal.cx>
Mon, 14 Jan 2013 23:04:49 +0000 (18:04 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 14 Jan 2013 23:04:49 +0000 (18:04 -0500)
38 files changed:
arch/arm/bits/errno.h
arch/arm/bits/fcntl.h
arch/arm/bits/mman.h
arch/arm/bits/termios.h
arch/i386/bits/errno.h
arch/i386/bits/fcntl.h
arch/i386/bits/mman.h
arch/i386/bits/termios.h
arch/microblaze/bits/errno.h
arch/microblaze/bits/fcntl.h
arch/microblaze/bits/mman.h
arch/microblaze/bits/termios.h
arch/mips/bits/fcntl.h
arch/mips/bits/mman.h
arch/powerpc/bits/errno.h
arch/powerpc/bits/fcntl.h
arch/powerpc/bits/mman.h
arch/x86_64/bits/errno.h
arch/x86_64/bits/fcntl.h
arch/x86_64/bits/mman.h
arch/x86_64/bits/termios.h
include/netinet/in.h
include/sys/epoll.h
include/sys/inotify.h
include/sys/mount.h
include/sys/ptrace.h
include/sys/reboot.h
include/sys/signalfd.h
include/sys/socket.h
include/sys/swap.h
include/sys/timex.h
src/aio/lio_listio.c
src/crypt/crypt_des.c
src/crypt/crypt_md5.c
src/crypt/crypt_sha256.c
src/crypt/crypt_sha512.c
src/ldso/dynlink.c
src/regex/regexec.c

index c75720e..d2e1eee 100644 (file)
 #define EOWNERDEAD      130
 #define ENOTRECOVERABLE 131
 #define ERFKILL         132
+#define EHWPOISON       133
index 9595f9c..98e91d5 100644 (file)
@@ -34,3 +34,5 @@
 
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
+
+#define F_GETOWNER_UIDS 17
index 2f23d44..8c4110f 100644 (file)
 #define MAP_DENYWRITE  0x0800
 #define MAP_EXECUTABLE 0x1000
 #define MAP_LOCKED     0x2000
+#define MAP_POPULATE   0x8000
+#define MAP_NONBLOCK   0x10000
+#define MAP_STACK      0x20000
+#define MAP_HUGETLB    0x40000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
+#define MADV_SOFT_OFFLINE 101
 
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
index 9f6abd8..61c888f 100644 (file)
@@ -144,6 +144,7 @@ struct termios
 #define ECHOKE 0004000
 #define FLUSHO 0010000
 #define PENDIN 0040000
+#define EXTPROC 0200000
 
 #define TCOOFF 0
 #define TCOON  1
index c75720e..d2e1eee 100644 (file)
 #define EOWNERDEAD      130
 #define ENOTRECOVERABLE 131
 #define ERFKILL         132
+#define EHWPOISON       133
index 69f3a8f..4cc0312 100644 (file)
@@ -34,3 +34,5 @@
 
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
+
+#define F_GETOWNER_UIDS 17
index 4083c19..add6385 100644 (file)
 #define MAP_DENYWRITE  0x0800
 #define MAP_EXECUTABLE 0x1000
 #define MAP_LOCKED     0x2000
+#define MAP_POPULATE   0x8000
+#define MAP_NONBLOCK   0x10000
+#define MAP_STACK      0x20000
+#define MAP_HUGETLB    0x40000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
+#define MADV_SOFT_OFFLINE 101
 
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
index 9f6abd8..61c888f 100644 (file)
@@ -144,6 +144,7 @@ struct termios
 #define ECHOKE 0004000
 #define FLUSHO 0010000
 #define PENDIN 0040000
+#define EXTPROC 0200000
 
 #define TCOOFF 0
 #define TCOON  1
index c75720e..d2e1eee 100644 (file)
 #define EOWNERDEAD      130
 #define ENOTRECOVERABLE 131
 #define ERFKILL         132
+#define EHWPOISON       133
index 69f3a8f..4cc0312 100644 (file)
@@ -34,3 +34,5 @@
 
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
+
+#define F_GETOWNER_UIDS 17
index 2f23d44..8c4110f 100644 (file)
 #define MAP_DENYWRITE  0x0800
 #define MAP_EXECUTABLE 0x1000
 #define MAP_LOCKED     0x2000
+#define MAP_POPULATE   0x8000
+#define MAP_NONBLOCK   0x10000
+#define MAP_STACK      0x20000
+#define MAP_HUGETLB    0x40000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
+#define MADV_SOFT_OFFLINE 101
 
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
index 9f6abd8..61c888f 100644 (file)
@@ -144,6 +144,7 @@ struct termios
 #define ECHOKE 0004000
 #define FLUSHO 0010000
 #define PENDIN 0040000
+#define EXTPROC 0200000
 
 #define TCOOFF 0
 #define TCOON  1
index c681d23..c51ee7e 100644 (file)
@@ -34,3 +34,5 @@
 
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
+
+#define F_GETOWNER_UIDS 17
index 3e6faa4..ac8dd5e 100644 (file)
 #define MAP_DENYWRITE  0x2000
 #define MAP_EXECUTABLE 0x4000
 #define MAP_LOCKED     0x8000
+#define MAP_POPULATE   0x10000
+#define MAP_NONBLOCK   0x20000
+#define MAP_STACK      0x40000
+#define MAP_HUGETLB    0x80000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
@@ -47,6 +51,8 @@
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
 
 #define MREMAP_MAYMOVE  1
index 9a193a2..36ad2f9 100644 (file)
 #define EOWNERDEAD      130
 #define ENOTRECOVERABLE 131
 #define ERFKILL         132
+#define EHWPOISON       133
index 83c0222..b57bd57 100644 (file)
@@ -35,3 +35,4 @@
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
 
+#define F_GETOWNER_UIDS 17
index 0c6cc32..15e3049 100644 (file)
 #define MAP_DENYWRITE  0x0800
 #define MAP_EXECUTABLE 0x1000
 #define MAP_LOCKED     0x80
+#define MAP_POPULATE   0x8000
+#define MAP_NONBLOCK   0x10000
+#define MAP_STACK      0x20000
+#define MAP_HUGETLB    0x40000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
+#define MADV_SOFT_OFFLINE 101
 
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
index c75720e..d2e1eee 100644 (file)
 #define EOWNERDEAD      130
 #define ENOTRECOVERABLE 131
 #define ERFKILL         132
+#define EHWPOISON       133
index 9e07229..0949f31 100644 (file)
@@ -34,3 +34,5 @@
 
 #define F_SETOWN_EX 15
 #define F_GETOWN_EX 16
+
+#define F_GETOWNER_UIDS 17
index c4cd8ae..dcab47a 100644 (file)
 #define MAP_DENYWRITE  0x0800
 #define MAP_EXECUTABLE 0x1000
 #define MAP_LOCKED     0x2000
+#define MAP_POPULATE   0x8000
+#define MAP_NONBLOCK   0x10000
+#define MAP_STACK      0x20000
+#define MAP_HUGETLB    0x40000
 
 #define POSIX_MADV_NORMAL       0
 #define POSIX_MADV_RANDOM       1
 #define MADV_UNMERGEABLE 13
 #define MADV_HUGEPAGE    14
 #define MADV_NOHUGEPAGE  15
+#define MADV_DONTDUMP    16
+#define MADV_DODUMP      17
 #define MADV_HWPOISON    100
+#define MADV_SOFT_OFFLINE 101
 
 #define MREMAP_MAYMOVE  1
 #define MREMAP_FIXED    2
index 9f6abd8..61c888f 100644 (file)
@@ -144,6 +144,7 @@ struct termios
 #define ECHOKE 0004000
 #define FLUSHO 0010000
 #define PENDIN 0040000
+#define EXTPROC 0200000
 
 #define TCOOFF 0
 #define TCOON  1
index 1086f07..fcab298 100644 (file)
@@ -5,6 +5,8 @@
 extern "C" {
 #endif
 
+#include <features.h>
+
 #define __NEED_in_addr_t
 #define __NEED_in_port_t
 #define __NEED_sa_family_t
@@ -203,6 +205,21 @@ uint16_t ntohs(uint16_t);
 #define IP_ADD_SOURCE_MEMBERSHIP  39
 #define IP_DROP_SOURCE_MEMBERSHIP 40
 #define IP_MSFILTER        41
+#define IP_MULTICAST_ALL   49
+#define IP_UNICAST_IF      50
+
+#ifdef _GNU_SOURCE
+#define MCAST_JOIN_GROUP   42
+#define MCAST_BLOCK_SOURCE 43
+#define MCAST_UNBLOCK_SOURCE      44
+#define MCAST_LEAVE_GROUP  45
+#define MCAST_JOIN_SOURCE_GROUP   46
+#define MCAST_LEAVE_SOURCE_GROUP  47
+#define MCAST_MSFILTER     48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+#endif
 
 #define IP_RECVRETOPTS IP_RETOPTS
 
index 0ff3d49..5e131ab 100644 (file)
@@ -28,6 +28,7 @@ enum EPOLL_EVENTS { __EPOLL_DUMMY };
 #define EPOLLERR 0x008
 #define EPOLLHUP 0x010
 #define EPOLLRDHUP 0x2000
+#define EPOLLWAKEUP (1U<<29)
 #define EPOLLONESHOT (1U<<30)
 #define EPOLLET (1U<<31)
 
index fe25136..a5bf96a 100644 (file)
@@ -39,6 +39,7 @@ struct inotify_event {
 
 #define IN_ONLYDIR       0x01000000
 #define IN_DONT_FOLLOW   0x02000000
+#define IN_EXCL_UNLINK   0x04000000
 #define IN_MASK_ADD      0x20000000
 
 #define IN_ISDIR         0x40000000
index 3f652e9..1e1907f 100644 (file)
@@ -30,18 +30,36 @@ extern "C" {
 #define MS_SYNCHRONOUS 16
 #define MS_REMOUNT     32
 #define MS_MANDLOCK    64
-#define S_WRITE        128
-#define S_APPEND       256
-#define S_IMMUTABLE    512
+#define MS_DIRSYNC     128
 #define MS_NOATIME     1024
 #define MS_NODIRATIME  2048
 #define MS_BIND        4096
 #define MS_MOVE        8192
+#define MS_REC         16384
 #define MS_SILENT      32768
+#define MS_POSIXACL    (1<<16)
+#define MS_UNBINDABLE  (1<<17)
+#define MS_PRIVATE     (1<<18)
+#define MS_SLAVE       (1<<19)
+#define MS_SHARED      (1<<20)
+#define MS_RELATIME    (1<<21)
+#define MS_KERNMOUNT   (1<<22)
+#define MS_I_VERSION   (1<<23)
+#define MS_STRICTATIME (1<<24)
+#define MS_NOSEC       (1<<28)
+#define MS_BORN        (1<<29)
+#define MS_ACTIVE      (1<<30)
+#define MS_NOUSER      (1U<<31)
+
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
 
 #define MS_MGC_VAL 0xc0ed0000
+#define MS_MGC_MSK 0xffff0000
 
-#define MNT_FORCE 1
+#define MNT_FORCE       1
+#define MNT_DETACH      2
+#define MNT_EXPIRE      4
+#define UMOUNT_NOFOLLOW 8
 
 int mount(const char *, const char *, const char *, unsigned long, const void *);
 int umount(const char *);
index d7e8c76..21d4ca3 100644 (file)
@@ -29,6 +29,11 @@ extern "C" {
 #define PTRACE_GETEVENTMSG 0x4201
 #define PTRACE_GETSIGINFO 0x4202
 #define PTRACE_SETSIGINFO 0x4203
+#define PTRACE_GETREGSET 0x4204
+#define PTRACE_SETREGSET 0x4205
+#define PTRACE_SEIZE 0x4206
+#define PTRACE_INTERRUPT 0x4207
+#define PTRACE_LISTEN 0x4208
 
 #define PT_READ_I PTRACE_PEEKTEXT
 #define PT_READ_D PTRACE_PEEKDATA
@@ -60,7 +65,9 @@ extern "C" {
 #define PTRACE_O_TRACEEXEC      0x00000010
 #define PTRACE_O_TRACEVFORKDONE 0x00000020
 #define PTRACE_O_TRACEEXIT      0x00000040
-#define PTRACE_O_MASK           0x0000007f
+#define PTRACE_O_TRACESECCOMP   0x00000080
+#define PTRACE_O_EXITKILL       0x00100000
+#define PTRACE_O_MASK           0x001000ff
 
 #define PTRACE_EVENT_FORK 1
 #define PTRACE_EVENT_VFORK 2
@@ -68,6 +75,7 @@ extern "C" {
 #define PTRACE_EVENT_EXEC 4
 #define PTRACE_EVENT_VFORK_DONE 5
 #define PTRACE_EVENT_EXIT 6
+#define PTRACE_EVENT_SECCOMP 7
 
 long ptrace(int, ...);
 
index 26cc308..9702edd 100644 (file)
@@ -9,6 +9,8 @@ extern "C" {
 #define RB_ENABLE_CAD   0x89abcdef
 #define RB_DISABLE_CAD  0
 #define RB_POWER_OFF    0x4321fedc
+#define RB_SW_SUSPEND   0xd000fce2
+#define RB_KEXEC        0x45584543
 
 int reboot(int);
 
index 297aac7..4f3d399 100644 (file)
@@ -6,13 +6,14 @@ extern "C" {
 #endif
 
 #include <stdint.h>
+#include <fcntl.h>
 
 #define __NEED_sigset_t
 
 #include <bits/alltypes.h>
 
-#define SFD_CLOEXEC 02000000
-#define SFD_NONBLOCK 04000
+#define SFD_CLOEXEC O_CLOEXEC
+#define SFD_NONBLOCK O_NONBLOCK
 
 int signalfd(int, const sigset_t *, int);
 
index 19b2aa5..cf042eb 100644 (file)
@@ -76,10 +76,14 @@ struct linger
 #define PF_ASH          18
 #define PF_ECONET       19
 #define PF_ATMSVC       20
+#define PF_RDS          21
 #define PF_SNA          22
 #define PF_IRDA         23
 #define PF_PPPOX        24
 #define PF_WANPIPE      25
+#define PF_LLC          26
+#define PF_CAN          29
+#define PF_TIPC         30
 #define PF_BLUETOOTH    31
 #define PF_IUCV         32
 #define PF_RXRPC        33
@@ -88,7 +92,8 @@ struct linger
 #define PF_IEEE802154   36
 #define PF_CAIF         37
 #define PF_ALG          38
-#define PF_MAX          39
+#define PF_NFC          39
+#define PF_MAX          40
 
 #define AF_UNSPEC       PF_UNSPEC
 #define AF_LOCAL        PF_LOCAL
@@ -114,10 +119,14 @@ struct linger
 #define AF_ASH          PF_ASH
 #define AF_ECONET       PF_ECONET
 #define AF_ATMSVC       PF_ATMSVC
+#define AF_RDS          PF_RDS
 #define AF_SNA          PF_SNA
 #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
@@ -126,6 +135,7 @@ struct linger
 #define AF_IEEE802154   PF_IEEE802154
 #define AF_CAIF         PF_CAIF
 #define AF_ALG          PF_ALG
+#define AF_NFC          PF_NFC
 #define AF_MAX          PF_MAX
 
 #ifndef SO_DEBUG
index 1bd6159..11c0f92 100644 (file)
@@ -9,6 +9,7 @@ extern "C" {
 #define        SWAP_FLAG_PREFER        0x8000
 #define        SWAP_FLAG_PRIO_MASK     0x7fff
 #define        SWAP_FLAG_PRIO_SHIFT    0
+#define SWAP_FLAG_DISCARD       0x10000
 
 int swapon (const char *, int);
 int swapoff (const char *);
index f37c13c..08f4b09 100644 (file)
@@ -50,6 +50,7 @@ struct timex {
 #define MOD_TIMECONST  ADJ_TIMECONST
 #define MOD_CLKB       ADJ_TICK
 #define MOD_CLKA       ADJ_OFFSET_SINGLESHOT
+#define MOD_TAI                ADJ_TAI
 #define MOD_MICRO      ADJ_MICRO
 #define MOD_NANO       ADJ_NANO
 
@@ -74,7 +75,7 @@ struct timex {
 #define STA_CLK                0x8000
 
 #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
-    STA_PPSERROR | STA_CLOCKERR)
+    STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
 
 #define TIME_OK                0
 #define TIME_INS       1
index 532b17c..64a6ebc 100644 (file)
@@ -109,7 +109,7 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
        if (mode == LIO_WAIT) {
                ret = lio_wait(st);
                free(st);
-               return 0;
+               return ret;
        }
 
        if (st) {
index 4454a13..dc95dca 100644 (file)
@@ -879,10 +879,7 @@ static char *_crypt_extended_r_uut(const char *_key, const char *_setting, char
        const unsigned char *key = (const unsigned char *)_key;
        const unsigned char *setting = (const unsigned char *)_setting;
        struct expanded_key ekey;
-       union {
-               unsigned char c[8];
-               uint32_t i[2];
-       } keybuf;
+       unsigned char keybuf[8];
        unsigned char *p, *q;
        uint32_t count, salt, l, r0, r1;
        unsigned int i;
@@ -891,13 +888,13 @@ static char *_crypt_extended_r_uut(const char *_key, const char *_setting, char
         * Copy the key, shifting each character left by one bit and padding
         * with zeroes.
         */
-       q = keybuf.c;
-       while (q <= &keybuf.c[sizeof(keybuf.c) - 1]) {
+       q = keybuf;
+       while (q <= &keybuf[sizeof(keybuf) - 1]) {
                *q++ = *key << 1;
                if (*key)
                        key++;
        }
-       des_setkey(keybuf.c, &ekey);
+       des_setkey(keybuf, &ekey);
 
        if (*setting == _PASSWORD_EFMT1) {
                /*
@@ -925,14 +922,14 @@ static char *_crypt_extended_r_uut(const char *_key, const char *_setting, char
                        /*
                         * Encrypt the key with itself.
                         */
-                       des_cipher(keybuf.c, keybuf.c, 1, 0, &ekey);
+                       des_cipher(keybuf, keybuf, 1, 0, &ekey);
                        /*
                         * And XOR with the next 8 characters of the key.
                         */
-                       q = keybuf.c;
-                       while (q <= &keybuf.c[sizeof(keybuf.c) - 1] && *key)
+                       q = keybuf;
+                       while (q <= &keybuf[sizeof(keybuf) - 1] && *key)
                                *q++ ^= *key++ << 1;
-                       des_setkey(keybuf.c, &ekey);
+                       des_setkey(keybuf, &ekey);
                }
 
                memcpy(output, setting, 9);
index 02f2244..70ab8b9 100644 (file)
@@ -118,7 +118,7 @@ static void md5_init(struct md5 *s)
        s->h[3] = 0x10325476;
 }
 
-static void md5_sum(struct md5 *s, uint8_t md[16])
+static void md5_sum(struct md5 *s, uint8_t *md)
 {
        int i;
 
index 076e4b1..e01a208 100644 (file)
@@ -119,7 +119,7 @@ static void sha256_init(struct sha256 *s)
        s->h[7] = 0x5be0cd19;
 }
 
-static void sha256_sum(struct sha256 *s, uint8_t md[20])
+static void sha256_sum(struct sha256 *s, uint8_t *md)
 {
        int i;
 
index 0f1de81..8325d77 100644 (file)
@@ -136,7 +136,7 @@ static void sha512_init(struct sha512 *s)
        s->h[7] = 0x5be0cd19137e2179ULL;
 }
 
-static void sha512_sum(struct sha512 *s, uint8_t md[20])
+static void sha512_sum(struct sha512 *s, uint8_t *md)
 {
        int i;
 
index 935367e..782e979 100644 (file)
@@ -1091,6 +1091,15 @@ end:
        return p;
 }
 
+static int invalid_dso_handle(struct dso *h)
+{
+       struct dso *p;
+       for (p=head; p; p=p->next) if (h==p) return 0;
+       snprintf(errbuf, sizeof errbuf, "Invalid library handle %p", (void *)h);
+       errflag = 1;
+       return 1;
+}
+
 static void *do_dlsym(struct dso *p, const char *s, void *ra)
 {
        size_t i;
@@ -1110,6 +1119,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
                        return __tls_get_addr((size_t []){def.dso->tls_id, def.sym->st_value});
                return def.dso->base + def.sym->st_value;
        }
+       if (invalid_dso_handle(p)) return 0;
        if (p->ghashtab) {
                gh = gnu_hash(s);
                sym = gnu_lookup(s, gh, p);
@@ -1236,6 +1246,12 @@ int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void
        return ret;
 }
 #else
+static int invalid_dso_handle(struct dso *h)
+{
+       snprintf(errbuf, sizeof errbuf, "Invalid library handle %p", (void *)h);
+       errflag = 1;
+       return 1;
+}
 void *dlopen(const char *file, int mode)
 {
        return 0;
@@ -1259,5 +1275,5 @@ char *dlerror()
 
 int dlclose(void *p)
 {
-       return 0;
+       return invalid_dso_handle(p);
 }
index 855cef5..674c590 100644 (file)
@@ -596,7 +596,6 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
      started from. */
   int next_c_start;
   const char *str_byte_start;
-  int pos_start = -1;
 #ifdef TRE_MBSTATE
   mbstate_t mbstate_start;
 #endif /* TRE_MBSTATE */
@@ -676,9 +675,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
   }
 
   state = NULL;
-  pos = pos_start;
   GET_NEXT_WCHAR();
-  pos_start = pos;
   next_c_start = next_c;
   str_byte_start = str_byte;
 #ifdef TRE_MBSTATE