]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/BsdSocketLib/poll.c
Fix a bug about the iSCSI DHCP dependency issue.
[mirror_edk2.git] / StdLib / BsdSocketLib / poll.c
CommitLineData
d7ce7006 1/** @file\r
2 Implement the poll API.\r
3\r
4 Copyright (c) 2011, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <SocketInternals.h>\r
16\r
17\r
18/**\r
19 Poll the socket for activity\r
20\r
21 @param [in] pDescriptor Descriptor address for the file\r
22\r
23 @param [in] Events Mask of events to detect\r
24\r
7dc13291 25 @return Detected events for the socket\r
d7ce7006 26\r
27 **/\r
28short\r
7700f0f5 29EFIAPI\r
d7ce7006 30BslSocketPoll (\r
31 IN struct __filedes * pDescriptor,\r
32 IN short Events\r
33 )\r
34{\r
35 short DetectedEvents;\r
36 EFI_SOCKET_PROTOCOL * pSocketProtocol;\r
37 EFI_STATUS Status;\r
38\r
39 //\r
40 // Locate the socket protocol\r
41 //\r
42 DetectedEvents = 0;\r
43 pSocketProtocol = BslValidateSocketFd ( pDescriptor, &errno );\r
44 if ( NULL != pSocketProtocol ) {\r
45 //\r
46 // Poll the socket\r
47 //\r
48 Status = pSocketProtocol->pfnPoll ( pSocketProtocol,\r
49 Events,\r
50 &DetectedEvents,\r
51 &errno );\r
52 }\r
53\r
54 //\r
55 // Return the detected events\r
56 //\r
57 return DetectedEvents;\r
58}\r