+++ /dev/null
-/** @file\r
- Implement the shutdown API.\r
-\r
- Copyright (c) 2011, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <SocketInternals.h>\r
-\r
-\r
-/**\r
- Shutdown the socket receive and transmit operations\r
-\r
- The shutdown routine stops socket receive and transmit operations.\r
-\r
- The\r
- <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html">POSIX</a>\r
- documentation is available online.\r
-\r
- @param [in] s Socket file descriptor returned from ::socket.\r
-\r
- @param [in] how Which operations to shutdown\r
-\r
- @return This routine returns the zero (0) if successful or -1 when an\r
- error occurs. In the latter case, ::errno contains more details.\r
-\r
- **/\r
-int\r
-shutdown (\r
- int s,\r
- int how\r
- )\r
-{\r
- int RetVal;\r
- EFI_SOCKET_PROTOCOL * pSocketProtocol;\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Assume failure\r
- //\r
- RetVal = -1;\r
-\r
- //\r
- // Locate the context for this socket\r
- //\r
- pSocketProtocol = BslFdToSocketProtocol ( s, NULL, &errno );\r
- if ( NULL != pSocketProtocol ) {\r
- //\r
- // Receive the data from the socket\r
- //\r
- Status = pSocketProtocol->pfnShutdown ( pSocketProtocol,\r
- how,\r
- &errno );\r
- if ( !EFI_ERROR ( Status )) {\r
- //\r
- // Success\r
- //\r
- RetVal = 0;\r
- }\r
- }\r
-\r
- //\r
- // Return the operation status\r
- //\r
- return RetVal;\r
-}\r