From: ian Date: Mon, 26 Aug 2002 16:07:14 +0000 (+0000) Subject: Compiles and runs. Now all it needs is meat. X-Git-Tag: debian/1.1.1~182 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=commitdiff_plain;h=b6b8965fb2f837323809f9cbb72b9843f14a5b7a Compiles and runs. Now all it needs is meat. --- b6b8965fb2f837323809f9cbb72b9843f14a5b7a 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; +} +