The OpenNET Project / Index page

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

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

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

ctermid (3)
  • >> ctermid (3) ( Solaris man: Библиотечные вызовы )
  • ctermid (3) ( FreeBSD man: Библиотечные вызовы )
  • ctermid (3) ( Русские man: Библиотечные вызовы )
  • ctermid (3) ( Linux man: Библиотечные вызовы )
  • ctermid (3) ( POSIX man: Библиотечные вызовы )
  •  

    NAME

    ctermid, ctermid_r - generate path name for controlling terminal
     
    

    SYNOPSIS

    #include <stdio.h>
    
    char *ctermid(char *s);
    

    char *ctermid_r(char *s);
    

     

    DESCRIPTION

     

    ctermid()

    The ctermid() function generates the path name of the controlling terminal for the current process and stores it in a string.

    If s is a null pointer, the string is stored in an internal static area whose address is returned and whose contents are overwritten at the next call to ctermid(). Otherwise, s is assumed to point to a character array of at least L_ctermid elements. The path name is placed in this array and the value of s is returned. The constant L_ctermid is defined in the header <stdio.h>.  

    ctermid_r()

    The ctermid_r() function behaves as ctermid() except that if s is a null pointer, the function returns NULL.  

    USAGE

    The difference between ctermid() and ttyname(3C) is that ttyname() must be passed a file descriptor and returns the actual name of the terminal associated with that file descriptor, while ctermid() returns a string (/dev/tty) that will refer to the terminal if used as a file name. The ttyname() function is useful only if the process already has at least one file open to a terminal.

    The ctermid() function is unsafe in multithreaded applications. The ctermid_r() function is MT-Safe and should be used instead.

    When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should be used only with multithreaded applications.  

    ATTRIBUTES

    See attributes(5) for descriptions of the following attributes:

    ATTRIBUTE TYPEATTRIBUTE VALUE

    Interface Stabilityctermid() is Standard

    MT-Level

     

    SEE ALSO

    ttyname(3C), attributes(5)


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    ctermid()
    ctermid_r()
    USAGE
    ATTRIBUTES
    SEE ALSO


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




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

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