File: gnutls_record_send_file

package info (click to toggle)
gnutls28 3.8.9-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,872 kB
  • sloc: ansic: 388,071; asm: 117,804; sh: 18,477; makefile: 6,732; yacc: 1,858; python: 1,399; cpp: 1,243; perl: 995; sed: 16
file content (27 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27




@deftypefun {ssize_t} {gnutls_record_send_file} (gnutls_session_t @var{session}, int @var{fd}, off_t * @var{offset}, size_t @var{count})
@var{session}: is a @code{gnutls_session_t}  type.

@var{fd}: file descriptor from which to read data.

@var{offset}: Is relative to file offset, denotes the starting location for
reading.  after function returns, it point to position following
last read byte.

@var{count}: is the length of the data in bytes to be read from file and send.

This function sends data from  @code{fd} . If KTLS (kernel TLS) is enabled, it will
use the @code{sendfile()}  system call to avoid overhead of copying data between user
space and the kernel. Otherwise, this functionality is merely emulated by
calling @code{read()}  and @code{gnutls_record_send()} . If this implementation is
suboptimal, check whether KTLS is enabled using
@code{gnutls_transport_is_ktls_enabled()} .

If  @code{offset} is NULL then file offset is incremented by number of bytes send,
otherwise file offset remains unchanged.

@strong{Returns:} The number of bytes sent, or a negative error code.
@end deftypefun