Skip to content

Commit

Permalink
io: fix Linux include and UNIX_PATH_MAX fallback
Browse files Browse the repository at this point in the history
This makes it easier to compile against other C libraries
than glibc.
  • Loading branch information
ra-kalai authored and esmil committed Jan 7, 2016
1 parent c5dffb8 commit 9f5ebd9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lem/io/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
#include <sys/ucred.h>
#include <netinet/in.h>
extern char **environ;
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 104
#endif
#else
#include <linux/un.h>
#include <sys/un.h>
#include <sys/sendfile.h>
#endif

#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX (sizeof ((struct sockaddr_un *)0)->sun_path)
#endif

#include <lem-parsers.h>

static int
Expand Down

0 comments on commit 9f5ebd9

Please sign in to comment.