.\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" $Id: shutdown.2,v 1.1.1.1 1999/03/21 22:52:23 freitag Exp $ .\" .\" Modified Sat Jul 24 09:57:55 1993 by Rik Faith .\" Modified Tue Oct 22 22:04:51 1996 by Eric S. Raymond .\" Modified 1998 by Andi Kleen .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1996 Takeshi Hakamata .\" all rights reserved. .\" Translated into Japanese Fri Jul 5 14:02:15 1996 .\" by Takeshi Hakamata (a93sj077@j.dendai.ac.jp) .\" Modified Wed Nov 5 22:16:28 JST 1997 .\" by HANATAKA Shinya (hanataka@abyss.rim.or.jp) .\" Updated Mon Jan 13 01:03:18 JST 2000 by Kentaro Shirakata .\" Updated Mon Oct 15 03:22:24 JST 2001 by Kentaro Shirakata .\" Updated 2013-05-06, Akihiro MOTOKI .\" .TH SHUTDOWN 2 2012\-09\-06 Linux "Linux Programmer's Manual" .SH 名前 shutdown \- 全二重接続の一部を閉じる .SH 書式 \fB#include \fP .sp \fBint shutdown(int \fP\fIsockfd\fP\fB, int \fP\fIhow\fP\fB);\fP .SH 説明 \fBshutdown\fP() は、 \fIsockfd\fP に関連づけられているソケットによる全二重接続 (full\-duplex connection) の一部または全てを閉じる。 \fIhow\fP が \fBSHUT_RD\fP ならば、それ以降の受信を禁止する。 \fIhow\fP が \fBSHUT_WR\fP ならば、それ以降の送信を禁止する。 \fIhow\fP が \fBSHUT_RDWR\fP ならば、それ以降の送受信を禁止する。 .SH 返り値 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEBADF\fP \fIsockfd\fP が有効なディスクリプターでない。 .TP \fBEINVAL\fP \fIhow\fP に無効な値が指定された (バグが参照)。 .TP \fBENOTCONN\fP 指定されたソケットは接続されていない。 .TP \fBENOTSOCK\fP \fIsockfd\fP がソケットでなくファイルである。 .SH 準拠 POSIX.1\-2001, 4.4BSD (\fBshutdown\fP() 関数コールは 4.2BSD で初めて登場した)。 .SH 注意 \fBSHUT_RD\fP, \fBSHUT_WR\fP, \fBSHUT_RDWR\fP の各定数 (それぞれ 0, 1, 2 の値を持つ) は glibc\-2.1.91 以降、 \fI\fP で定義されている。 .SH バグ .\" FIXME . .\" https://bugzilla.kernel.org/show_bug.cgi?id=47111 現在の実装では \fIhow\fP の妥当性チェックはドメイン固有のコードの中で行われているが、 すべてのドメインでこれらのチェックが行われている訳ではない。 中でも注意すべきは、 UNIX ドメインソケットでは無効な値は単に無視される点である。 これは将来変更されるかもしれない。 .SH 関連項目 \fBconnect\fP(2), \fBsocket\fP(2), \fBsocket\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。