]>
git.proxmox.com Git - mirror_edk2.git/blob - StdLib/BsdSocketLib/read.c
2 Implement the read API.
4 Copyright (c) 2011, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <SocketInternals.h>
19 Read support routine for sockets
21 @param [in] pDescriptor Descriptor address for the file
22 @param [in] pOffset File offset
23 @param [in] LengthInBytes Number of bytes to read
24 @param [in] pBuffer Address of the buffer to receive the data
26 @return The number of bytes read or -1 if an error occurs.
31 struct __filedes
*pDescriptor
,
40 // Receive the data from the remote system
42 BytesRead
= recvfrom ( pDescriptor
->MyFD
,
50 // Return the number of bytes read