From b6b8965fb2f837323809f9cbb72b9843f14a5b7a Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 26 Aug 2002 16:07:14 +0000 Subject: [PATCH] Compiles and runs. Now all it needs is meat. --- base/troglodyte-Makefile | 20 ++++++++++++++++++++ dgram/misc.c | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 base/troglodyte-Makefile create mode 100644 dgram/misc.c diff --git a/base/troglodyte-Makefile b/base/troglodyte-Makefile new file mode 100644 index 0000000..2ae36d5 --- /dev/null +++ b/base/troglodyte-Makefile @@ -0,0 +1,20 @@ +OBJS= forwarder.o \ + main.o \ + misc.o \ + intr-sigio.o \ + bget/bget.o + +HDRS= misc.h \ + forwarder.h \ + intr.h + +CFLAGS= -g -Wall + +fvpn: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) + +%.o: %.c $(HDRS) + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< + +clean: + rm -f $(OBJS) *~ ./#*# diff --git a/dgram/misc.c b/dgram/misc.c new file mode 100644 index 0000000..1d37020 --- /dev/null +++ b/dgram/misc.c @@ -0,0 +1,14 @@ +/**/ + +#include "all.h" + +int setnonblock(int fd, int isnonblock) { + int r; + + r= fcntl(fd,F_GETFL); + if (r==-1) return -1; + r= fcntl(fd,F_SETFL, isnonblock ? r|O_NONBLOCK : r&~O_NONBLOCK); + if (r==-1) return -1; + return 0; +} + -- 2.30.2