VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/StdLib/BsdSocketLib/write.c@ 48674

Last change on this file since 48674 was 48674, checked in by vboxsync, 12 years ago

EFI: Export newly imported tinaocore UEFI sources to OSE.

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1/** @file
2 Implement the write API.
3
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
9
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.
12
13**/
14
15#include <SocketInternals.h>
16
17
18/**
19 Write support routine for sockets
20
21 @param [in] pDescriptor Descriptor address for the file
22 @param [in] pOffset File offset
23 @param [in] LengthInBytes Number of bytes to write
24 @param [in] pBuffer Address of the data
25
26 @return The number of bytes written or -1 if an error occurs.
27 In the case of an error, ::errno contains more details.
28
29**/
30ssize_t
31BslSocketWrite (
32 struct __filedes *pDescriptor,
33 off_t * pOffset,
34 size_t LengthInBytes,
35 const void * pBuffer
36 )
37{
38 ssize_t BytesWritten;
39
40 //
41 // Send the data using the socket
42 //
43 BytesWritten = send ( pDescriptor->MyFD,
44 pBuffer,
45 LengthInBytes,
46 0 );
47
48 //
49 // Return the number of bytes written
50 //
51 return BytesWritten;
52}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette