1: /*
   2: char id_symlnk[] = "@(#)symlnk_.c	1.1";
   3:  *
   4:  * make a symbolic link to a file
   5:  *
   6:  * calling sequence:
   7:  *	ierror = symlnk(name1, name2)
   8:  * where:
   9:  *	name1 is the pathname of an existing file
  10:  *	name2 is a pathname that will become a symbolic link to name1
  11:  *	ierror will be 0 if successful; a system error code otherwise.
  12:  */
  13: 
  14: #include    <sys/param.h>
  15: #include    "../libI77/fiodefs.h"
  16: 
  17: #ifndef MAXPATHLEN
  18: #define MAXPATHLEN  128
  19: #endif
  20: 
  21: ftnint symlnk_(name1, name2, n1len, n2len)
  22: char *name1, *name2;
  23: ftnlen n1len, n2len;
  24: {
  25:     char buf1[MAXPATHLEN];
  26:     char buf2[MAXPATHLEN];
  27: 
  28:     if (n1len >= sizeof buf1 || n2len >= sizeof buf2)
  29:         return((ftnint)(errno=F_ERARG));
  30:     g_char(name1, n1len, buf1);
  31:     g_char(name2, n2len, buf2);
  32:     if (buf1[0] == '\0' || buf2[0] == '\0')
  33:         return((ftnint)(errno=F_ERARG));
  34:     if (symlink(buf1, buf2) != 0)
  35:         return((ftnint)errno);
  36:     return((ftnint) 0);
  37: }

Defined functions

symlnk_ defined in line 21; never used

Defined macros

MAXPATHLEN defined in line 18; used 3 times
Last modified: 1983-07-08
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 582
Valid CSS Valid XHTML 1.0 Strict