From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/os/zflink.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 unix/os/zflink.c (limited to 'unix/os/zflink.c') diff --git a/unix/os/zflink.c b/unix/os/zflink.c new file mode 100644 index 00000000..34b5a780 --- /dev/null +++ b/unix/os/zflink.c @@ -0,0 +1,45 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#include +#include +#include + +#include +#define import_kernel +#define import_knames +#define import_spp +#include + + +/* ZFLINK -- Create a file symlink. + */ +int +ZFLINK ( + PKCHAR *path1, + PKCHAR *path2, + XINT *status +) +{ + /* Create a symlink 'path2' pointing to 'path1'. + */ + *status = (symlink ((char *) path1, (char *) path2) < 0) ? XERR : XOK; + + return (*status); +} + + +/* ZFULNK -- Remove a file symlink. + */ +int +ZFULNK ( + PKCHAR *path, + XINT *status +) +{ + /* Remove the link at 'path'. + */ + *status = (unlink ((char *) path) < 0) ? XERR : XOK; + + return (*status); +} -- cgit