]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Implement the poll API.\r | |
3 | \r | |
4 | Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials are licensed and made available under\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
7 | 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 | #include <SocketInternals.h>\r | |
14 | \r | |
15 | \r | |
16 | /** Poll the socket for activity\r | |
17 | \r | |
18 | @param [in] pDescriptor Descriptor address for the file\r | |
19 | @param [in] Events Mask of events to detect\r | |
20 | \r | |
21 | @return Detected events for the socket\r | |
22 | **/\r | |
23 | short\r | |
24 | EFIAPI\r | |
25 | BslSocketPoll (\r | |
26 | IN struct __filedes * pDescriptor,\r | |
27 | IN short Events\r | |
28 | )\r | |
29 | {\r | |
30 | short DetectedEvents;\r | |
31 | EFI_SOCKET_PROTOCOL * pSocketProtocol;\r | |
32 | \r | |
33 | // Locate the socket protocol\r | |
34 | DetectedEvents = 0;\r | |
35 | pSocketProtocol = BslValidateSocketFd ( pDescriptor, &errno );\r | |
36 | if ( NULL != pSocketProtocol ) {\r | |
37 | // Poll the socket\r | |
38 | (void) pSocketProtocol->pfnPoll ( pSocketProtocol,\r | |
39 | Events,\r | |
40 | &DetectedEvents,\r | |
41 | &errno );\r | |
42 | }\r | |
43 | // Return the detected events\r | |
44 | return DetectedEvents;\r | |
45 | }\r |