* SUCH DAMAGE.
*/
-#ifdef __linux__
-# define _BSD_SOURCE
-#endif
-
#include <sys/time.h>
#include <sys/types.h>
#include <arpa/inet.h>
* SUCH DAMAGE.
*/
-#ifdef __linux__
-# define _XOPEN_SOURCE 500 /* needed for pwrite */
-#endif
-
#include <sys/time.h>
#include <errno.h>
#include <fcntl.h>
const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
-/* We need to define this to get kill on GNU systems */
-#ifdef __linux__
-#define _BSD_SOURCE
-#define _POSIX_SOURCE
-#endif
-
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
fi
_RC!= ${_RC_SH}
RC= ${_RC}$(shell ${_RC_SH})
+
+# glibc requires _BSD_SOURCE and _XOPEN_SOURCE
+_DEF_SH= case `uname -s` in Linux) echo "-D_BSD_SOURCE -D_XOPEN_SOURCE=600";; *) echo;; esac
+_DEF!= ${_DEF_SH}
+CFLAGS+= ${_DEF}$(shell ${_DEF_SH})
* SUCH DAMAGE.
*/
-#ifdef __linux__
-# define _BSD_SOURCE
-#endif
-
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <net/if.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
+#define __FAVOUR_BSD /* Nasty hack so we can use BSD semantics for UDP */
#include <netinet/udp.h>
+#undef __FAVOUR_BSD
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>