Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both |
#include <unistd.h>
int extlink_np(const char *ename, const char *elink);
Creates the external symbolic link file named by elink with the object specified by ename. The ename is not resolved, and refers to an object outside the HFS (hierarchical file system). The variable elink is the name of the external symbolic link file created, and ename is the name of the object contained within that file.
If successful, extlink_np() returns 0.
⁄* CELEBE07
This example creates an external symbolic link.
*⁄
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys⁄stat.h>
#include <sys⁄types.h>
main( argc, argv )
int argc ;
char *argv ;
{
int i_rc ;
int i_fd ;
char ac_mvsds[] = "SYS1.LINKLIB" ;
char ac_mvsdsextsymlnk[] = "sys1.linklib.extsymlink" ;
i_rc = unlink( ac_mvsdsextsymlnk ) ;
if (( i_rc == -1 ) && ( errno == ENOENT )) {
}
else
{
perror( "unlink() error" ) ;
return( -1 ) ;
}
printf( "Before extlink_np() call ...\n" ) ;
system( "ls -il sys1.*" ) ;
i_rc = extlink_np( ac_mvsds, ac_mvsdsextsymlnk ) ;
if ( i_rc == -1 )
{
perror( "extlink_np() error" ) ;
return( -1 ) ;
}
printf( "After extlink_np() call ...\n" ) ;
system( "ls -il sys1.*" ) ;
i_rc = unlink( ac_mvsdsextsymlnk ) ;
}