valyala / ybc

Fast in-process BLOB cache with persistence support

Home Page:https://groups.google.com/forum/?fromgroups=#!forum/ybc-main

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Failing

adxBRudolph opened this issue · comments

I get the following trying to install/build:

go get -u -a github.com/valyala/ybc/libs/go/memcache
github.com/valyala/ybc/bindings/go/ybc
In file included from /usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform.h:240,
from /usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/ybc.c:1:
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c: In function ‘p_file_create’:
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c:362: error: ‘O_CLOEXEC’ undeclared (first use in this function)
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c:362: error: (Each undeclared identifier is reported only once
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c:362: error: for each function it appears in.)
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c: In function ‘p_file_open’:
/usr/local/go/bin/src/github.com/valyala/ybc/bindings/go/ybc/platform/linux.c:382: error: ‘O_CLOEXEC’ undeclared (first use in this function)

I tried the build again and it still failed after this commit.

What I did to resolve it was add the following lines after the "includes" in github.com/valyala/ybc/bindings/go/ybc/platform/linux.c

#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif

And the build then works.