avoid dependency on linux/limits.h header

it was causing a problem on the CI
This commit is contained in:
Andrew Kelley 2019-07-08 11:38:14 -04:00
parent 8692c6fc0d
commit 201033d83b
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -352,7 +352,6 @@ bool eql_glibc_target(const ZigTarget *a, const ZigTarget *b) {
#ifdef ZIG_OS_LINUX #ifdef ZIG_OS_LINUX
#include <unistd.h> #include <unistd.h>
#include <linux/limits.h>
Error glibc_detect_native_version(ZigGLibCVersion *glibc_ver) { Error glibc_detect_native_version(ZigGLibCVersion *glibc_ver) {
Buf *self_libc_path = get_self_libc_path(); Buf *self_libc_path = get_self_libc_path();
if (self_libc_path == nullptr) { if (self_libc_path == nullptr) {
@ -365,7 +364,7 @@ Error glibc_detect_native_version(ZigGLibCVersion *glibc_ver) {
return ErrorUnknownABI; return ErrorUnknownABI;
} }
Buf *link_name = buf_alloc(); Buf *link_name = buf_alloc();
buf_resize(link_name, PATH_MAX); buf_resize(link_name, 4096);
ssize_t amt = readlink(buf_ptr(self_libc_path), buf_ptr(link_name), buf_len(link_name)); ssize_t amt = readlink(buf_ptr(self_libc_path), buf_ptr(link_name), buf_len(link_name));
if (amt == -1) { if (amt == -1) {
return ErrorUnknownABI; return ErrorUnknownABI;