The OpenNET Project / Index page

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

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

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

devname_r (3)
  • >> devname_r (3) ( FreeBSD man: Библиотечные вызовы )

  • BSD mandoc
     

    NAME

    
    
    devname
    
     - get device name
    
     
    

    LIBRARY

    Lb libc
    
     
    

    SYNOPSIS

       #include <sys/stat.h>
       #include <stdlib.h>
    char * devname (dev_t dev mode_t type);
    char * devname_r (dev_t dev mode_t type char *buf int len);
     

    DESCRIPTION

    The devname ();
    function returns a pointer to the name of the block or character device in /dev with a device number of Fa dev , and a file type matching the one encoded in Fa type which must be one of S_IFBLK or S_IFCHR To find the right name, devname ();
    asks the kernel via the kern.devname sysctl. If it is unable to come up with a suitable name, it will format the information encapsulated in Fa dev and Fa type in a human-readable format.

    devname ();
    returns the name stored in a static buffer which will be overwritten on subsequent calls. devname_r ();
    takes a buffer and length as argument to avoid this problem.  

    EXAMPLES

    int fd;
    struct stat buf;
    char *name;
    
            fd = open("/dev/tun");
            fstat(fd, &buf);
            printf("devname is /dev/%s\n", devname(buf.st_rdev, S_IFCHR));
    
     

    SEE ALSO

    stat(2)  

    HISTORY

    The devname ();
    function appeared in BSD 4.4


     

    Index

    NAME
    LIBRARY
    SYNOPSIS
    DESCRIPTION
    EXAMPLES
    SEE ALSO
    HISTORY


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




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

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