Skip to content

Commit

Permalink
Add SUN_LEN when not defined (termux)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Rondeau <christian.rondeau@gmail.com>
Note that this code is found as-is in multiple `un.h` implementations.
Source and alternatives for SUN_LEN: https://stackoverflow.com/a/2307539/154480
  • Loading branch information
christianrondeau committed May 24, 2017
1 parent b8b20ea commit dfd7ea2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
#include <sys/param.h>
#endif

#if !defined(SUN_LEN)
#define SUN_LEN(su) \
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif

#if !defined(__linux__) && !defined(__CYGWIN__)
#define SOCKET_SEND_PID 1
struct ucred {
Expand Down

0 comments on commit dfd7ea2

Please sign in to comment.