Site Tools


Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
Hotfix release available: 2018-04-22a "Greebo". upgrade now! [50.1] (what's this?)
New release available: 2018-04-22 "Greebo". upgrade now! [50] (what's this?)
Hotfix release available: 2017-02-19g "Frusterick Manners". upgrade now! [49.7] (what's this?)
Hotfix release available: 2017-02-19f "Frusterick Manners". upgrade now! [49.6] (what's this?)
Hotfix release available: 2017-02-19e "Frusterick Manners". upgrade now! [49.5] (what's this?)
Hotfix release available fixing CVE-2017-12979 and CVE-2017-12980: 2017-02-19d "Frusterick Manners". upgrade now! [49.4] (what's this?)
Hotfix release available fixing CVE-2017-12583: 2017-02-19c "Frusterick Manners". upgrade now! [49.3] (what's this?)
wiki:socketpair

소켓에 주소가없으므로 nameless 소켓 함수라고한다.

socketpair로 생성된 socket은 read,write 구분없이 모두 가능(주로 프로세스간 통신에 이용함)

시스템 콜은 옵션으로 지정한 protocol을 사용하여 지정한 도메인에서 지정한 type의 접속된 소켓의 이름없는 쌍을 만든다.

전이중 통신을 지원하게 된다.

#include <sys/types.h>
#include <sys/socket.h>

int socketpair(int d, int type, int protocol, int sv[2]);

옵션으로 d영역(domain)을 가지며 protocol프로토콜을 사용하는 type의 소켓 쌍을 생성한다. 생성된 소켓 쌍은 sv를 통해서 넘어온다. 두개의 소켓은 서로 구별할 수 없다.

성공시 0을 반환하고 실패할 경우 -1을 반환한다.

에러

EMFILE : 너무 많은 파일이 열려있어서 더이상 소켓을 생성할 수 없다.

EAFNOSUPPORT : 지정한 주소 지정방식이 지원되지 않는다.

EPROTONOSUPPORT : 지정된 프로토콜이 지원되지 않는다.

EFAULT : 주소 ev가 프로세스 주소 공간의 유효한 부분을 가리키지 않는다.



























                    
                                    
wiki/socketpair.txt · Last modified: 2017/12/08 12:37 by 1.241.172.144