The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

VOP_LINK (9)
  • >> VOP_LINK (9) ( FreeBSD man: Ядро )

  • BSD mandoc
     

    NAME

    VOP_LINK
    
     - create a new name for a file
    
     
    

    SYNOPSIS

       #include <sys/param.h>
       #include <sys/vnode.h>
    int VOP_LINK (struct vnode *dvp struct vnode *vp struct componentname *cnp);
     

    DESCRIPTION

    This links a new name in the specified directory to an existing file.

    Its arguments are:

    Fa dvp
    The vnode of the directory.
    Fa vp
    The vnode of the file to be linked.
    Fa cnp
    Pathname information about the file.

    The pathname info should not be released on exit because it is done by the caller. The directory and file vnodes should not be released on exit.  

    LOCKS

    VOP_LINK ();
    expects the directory and file vnodes to be locked on entry and will leave the vnodes locked on return.  

    RETURN VALUES

    Zero is returned if the file was linked successfully, otherwise an error is returned.  

    PSEUDOCODE

    int
    vop_link(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
    {
        int error = 0;
    
        if (vp->v_mount != dvp->v_mount)
            return (EXDEV);
    
        if (vp would have too many links)
            return (EMLINK);
    
        if (vp is immutable)
            return (EPERM);
    
        /*
         * Increment link count of vp and write back the on-disc version of it.
         */
        ...;
    
        if (!error) {
            /*
             * Add the new name to the directory.
             */
            ...;
        }
    
        return error;
    }
    
     

    ERRORS

    Bq Er EMLINK
    The file has too many links.
    Bq Er EPERM
    The file is immutable.
    Bq Er EXDEV
    A hard link is not possible between different file systems.

     

    SEE ALSO

    vn_lock9, vnode(9)  

    AUTHORS

    This manual page was originally written by An Doug Rabson .


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    LOCKS
    RETURN VALUES
    PSEUDOCODE
    ERRORS
    SEE ALSO
    AUTHORS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру