#include "asm/unistd_64.h" // for __NR_ioctl #include // for SIOCATMARK #include // for __syscall_3, syscall int sockatmark(int s) { int arg = 0; return syscall(ioctl, s, SIOCATMARK, &arg) < 0 ? -1 : arg; }