home *** CD-ROM | disk | FTP | other *** search
- /* make a hard link */
-
- #include <errno.h>
- #include <mintbind.h>
- #include <param.h>
- #include "lib.h"
-
- extern int __mint;
-
- /*
- * if MiNT is not active, we try to fail gracefully
- */
-
- int
- link(_old, _new)
- char *_old, *_new;
- {
- long r;
- char old[MAXPATHLEN], new[MAXPATHLEN];
-
- if (__mint < 9) {
- errno = EXDEV;
- return -1;
- }
- _unx2dos(_old, old);
- _unx2dos(_new, new);
-
- r = Flink(old, new);
- if (r < 0) {
- errno = (int) -r;
- return -1;
- }
- return 0;
- }
-