src/java/org/apache/cassandra/utils/CLibrary.java
/**
     * Create a hard link for a given file.
     *
     * @param sourceFile      The name of the source file.
     * @param destinationFile The name of the destination file.
     *
     * @throws java.io.IOException if an error has occurred while creating the link.
     */
Create a hard link for a given file.
@param sourceFile      The name of the source file.
@param destinationFile The name of the destination file.

@throws java.io.IOException if an error has occurred while creating the link.
Create a hard link for a given file . @param sourceFile The name of the source file . @param destinationFile The name of the destination file . @throws java . io . IOException if an error has occurred while creating the link .
public static void createHardLink(File sourceFile, File destinationFile) throws IOException
    {
        try
        {
            int result = link(sourceFile.getAbsolutePath(), destinationFile.getAbsolutePath());
            assert result == 0; 
        }
        catch (UnsatisfiedLinkError e)
        {
            createHardLinkWithExec(sourceFile, destinationFile);
        }
        catch (RuntimeException e)
        {
            logger.error("Unable to create hard link", e);
            if (!(e instanceof LastErrorException))
                throw e;
            throw new IOException(String.format("Unable to create hard link from %s to %s (errno %d)",
                                                sourceFile, destinationFile, errno(e)));
        }
    }
public static void createHardLink ( File sourceFile , File destinationFile ) throws IOException { try { int result = link ( sourceFile . getAbsolutePath ( ) , destinationFile . getAbsolutePath ( ) ) ; assert result == 0 ; } catch ( UnsatisfiedLinkError e ) { createHardLinkWithExec ( sourceFile , destinationFile ) ; } catch ( RuntimeException e ) { logger . error ( "Unable to create hard link" , e ) ; if ( ! ( e instanceof LastErrorException ) ) throw e ; throw new IOException ( String . format ( "Unable to create hard link from %s to %s (errno %d)" , sourceFile , destinationFile , errno ( e ) ) ) ; } }
Create a hard link for a given file.
Create a hard link for a given file .
// success is always zero // there are 17 different error codes listed on the man page.  punt until/unless we find which // ones actually turn up in practice.