fix sendfile syscall to use 64-bit off_t

somehow the remapping of this syscall to the 64-bit version was
overlooked. the issue was found, and patch provided, by Stefan
Kristiansson. presumably the reason this bug was not caught earlier is
that the syscall takes a pointer to off_t rather than a value, so on
little-endian systems, everything appears to work as long as the
offset value fits in the low 31 bits. on big-endian systems, though,
sendfile was presumably completely non-functional.

corresponds to commit 55f45bc7222ec50b72aa8411c61e30184d0ade23 in
master branch.
fix for broken kernel side RLIM_INFINITY on mips

On 32 bit mips the kernel uses -1UL/2 to mark RLIM_INFINITY (and
this is the definition in the userspace api), but since it is in
the middle of the valid range of limits and limits are often
compared with relational operators, various kernel side logic is
broken if larger than -1UL/2 limits are used. So we truncate the
limits to -1UL/2 in get/setrlimit and prlimit.

Even if the kernel side logic consistently treated -1UL/2 as greater
than any other limit value, there wouldn't be any clean workaround
that allowed using large limits:
* using -1UL/2 as RLIM_INFINITY in userspace would mean different
infinity value for get/setrlimt and prlimit (where infinity is always
-1ULL) and userspace logic could break easily (just like the kernel
is broken now) and more special case code would be needed for mips.
* translating -1UL/2 kernel side value to -1ULL in userspace would
mean that -1UL/2 limit cannot be set (eg. -1UL/2+1 had to be passed
to the kernel instead).

(cherry picked from commit 8258014fd1e34e942a549c88c7e022a00445c352)
fix incorrect end pointer in some cases when wcsrtombs stops early

when wcsrtombs stopped due to hitting zero remaining space in the
output buffer, it was wrongly clearing the position pointer as if it
had completed the conversion successfully.

this commit rearranges the code somewhat to make a clear separation
between the cases of ending due to running out of output buffer space,
and ending due to reaching the end of input or an illegal sequence in
the input. the new branches have been arranged with the hope of
optimizing more common cases, too.

(cherry picked from commit 8fba4458afb7304b32ca887e4a3990c6029131f9)
fix if_nametoindex return value when interface does not exist

the return value is unsigned, so negative results for "errors" do not
make sense; 0 is the value reserved for when the interface name does
not exist.

(cherry picked from commit 8041af59881219c32267c3491bee43591d3c3fe6)
remove some dummy "ent" function aliases that duplicated real ones

the service and protocol functions are defined also in other files,
and the protocol ones are actually non-nops elsewhere, so the weak
definitions in ent.c could have prevented the strong definitions from
getting pulled in and used in some static programs.

(cherry picked from commit 934aa1350b96461f205ad69c95e8f6f035f6b62c)
fix multiple validation issues in dns response label parsing

Due to an error introduced in commit fcc522c92335783293ac19df318415cd97fbf66b,
checking of the remaining output buffer space was not performed correctly,
allowing malformed input to write past the end of the buffer.

In addition, the loop detection logic failed to account for the possibility
of infinite loops with no output, which would hang the function.

The output size is now limited more strictly so only names with valid length
are accepted.

(cherry picked from commit b3d9e0b94ea73c68ef4169ec82c898ce59a4e30a)
release 1.0.3