date and time created 81/02/19 10:55:13 by dlw
authorDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Fri, 20 Feb 1981 02:55:13 +0000 (18:55 -0800)
committerDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Fri, 20 Feb 1981 02:55:13 +0000 (18:55 -0800)
SCCS-vsn: usr.bin/f77/libU77/unlink_.c 1.1

usr/src/usr.bin/f77/libU77/unlink_.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/f77/libU77/unlink_.c b/usr/src/usr.bin/f77/libU77/unlink_.c
new file mode 100644 (file)
index 0000000..2cba1fd
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+char id_unlink[] = "@(#)unlink_.c      1.1";
+ *
+ * unlink (remove) a file
+ *
+ * calling sequence:
+ *     integer unlink
+ *     ierror = unlink(filename)
+ * where:
+ *     ierror will be a returned status (0 == OK)
+ *     filename is the file to be unlinked
+ */
+
+#include "../libI77/f_errno.h"
+
+long
+unlink_(fname, namlen)
+char *fname;
+long namlen;
+{
+       char buf[128];
+
+       if (namlen >= sizeof buf)
+               return((long)(errno=F_ERARG));
+       g_char(fname, namlen, buf);
+       if (unlink(buf) != 0)
+               return((long)errno);
+       return(0L);
+}