netatalk: ad_recvfile.c File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
ad_recvfile.c File Reference
`#include <errno.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <sys/select.h>`
`#include <sys/socket.h>`
`#include <sys/uio.h>`
`#include <atalk/adouble.h>`
`#include <atalk/logger.h>`
`#include <atalk/util.h>`

## Macros
#define | TRANSFER_BUF_SIZE (128*1024)

## Functions
static int | ad_recvfile_init (const struct adouble *ad, int eid, off_t *off)
static ssize_t | default_sys_recvfile (int fromfd, int tofd, off_t offset, size_t count)
static int | waitfordata (int socket)
static ssize_t | sys_recvfile (int fromfd, int tofd, off_t offset, size_t count, int splice_size)
ssize_t | ad_recvfile (struct adouble *ad, int eid, int sock, off_t off, size_t len, int splice_size)

## Macro Definition Documentation

## ◆ TRANSFER_BUF_SIZE

#define TRANSFER_BUF_SIZE (128*1024)

## Function Documentation

## ◆ ad_recvfile()

ssize_t ad_recvfile | ( | struct adouble * | ad,
|  | int | eid,
|  | int | sock,
|  | off_t | off,
|  | size_t | len,
|  | int | splice_size )

read from a socket and write to an adouble file

## ◆ ad_recvfile_init()

int ad_recvfile_init | ( | const struct adouble * | ad,
|  | int | eid,
|  | off_t * | off )
| static

## ◆ default_sys_recvfile()

ssize_t default_sys_recvfile | ( | int | fromfd,
|  | int | tofd,
|  | off_t | offset,
|  | size_t | count )
| static

If tofd is -1, drain the incoming socket of count bytes without writing to the outgoing fd, if a write fails we do the same.

Returns -1 on short reads from fromfd (read error) and sets errno.

Returns number of bytes written to 'tofd' or thrown away if 'tofd == -1'. return != count then sets errno. Returns count if complete success.

## ◆ sys_recvfile()

ssize_t sys_recvfile | ( | int | fromfd,
|  | int | tofd,
|  | off_t | offset,
|  | size_t | count,
|  | int | splice_size )
| static

## ◆ waitfordata()

int waitfordata | ( | int | socket | ) |
| static