The OpenNET Project / Index page

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

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

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

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

    NAME

    dup2 - duplicate an open file descriptor
     
    

    SYNOPSIS

    #include <unistd.h>
    
    int dup2(int fildes, int fildes2);
    

     

    DESCRIPTION

    The dup2() function causes the file descriptor fildes2 to refer to the same file as fildes. The fildes argument is a file descriptor referring to an open file, and fildes2 is a non-negative integer less than the current value for the maximum number of open file descriptors allowed the calling process. See getrlimit(2). If fildes2 already refers to an open file, not fildes, it is closed first. If fildes2 refers to fildes, or if fildes is not a valid open file descriptor, fildes2 will not be closed first.

    The dup2() function is equivalent to fcntl(fildes, F_DUP2FD, fildes2).  

    RETURN VALUES

    Upon successful completion a non-negative integer representing the file descriptor is returned. Otherwise, -1 is returned and errno is set to indicate the error.  

    ERRORS

    The dup2() function will fail if:

    EBADF

    The fildes argument is not a valid open file descriptor.

    EBADF

    The fildes2 argument is negative or is not less than the current resource limit returned by getrlimit(RLIMIT_NOFILE, ...).

    EINTR

    A signal was caught during the dup2() call.

    EMFILE

    The process has too many open files. See fcntl(2).

     

    ATTRIBUTES

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

    ATTRIBUTE TYPEATTRIBUTE VALUE

    Interface StabilityStandard

    MT-Level

     

    SEE ALSO

    close(2), creat(2), exec(2), fcntl(2), getrlimit(2), open(2), pipe(2), attributes(5), standards(5)


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    RETURN VALUES
    ERRORS
    ATTRIBUTES
    SEE ALSO


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




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

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