chiark / gitweb /
Compiles and runs. Now all it needs is meat.
authorian <ian>
Mon, 26 Aug 2002 16:07:14 +0000 (16:07 +0000)
committerian <ian>
Mon, 26 Aug 2002 16:07:14 +0000 (16:07 +0000)
base/troglodyte-Makefile [new file with mode: 0644]
dgram/misc.c [new file with mode: 0644]

diff --git a/base/troglodyte-Makefile b/base/troglodyte-Makefile
new file mode 100644 (file)
index 0000000..2ae36d5
--- /dev/null
@@ -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 (file)
index 0000000..1d37020
--- /dev/null
@@ -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;
+}
+