GNUnet  0.10.x
Functions
disk.h File Reference

Internal DISK related helper functions. More...

#include "gnunet_crypto_lib.h"
#include "gnunet_disk_lib.h"
Include dependency graph for disk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh, void *dst, size_t dst_len)
 Retrieve OS file handle. More...
 

Detailed Description

Internal DISK related helper functions.

Author
Nils Durner

Definition in file disk.h.

Function Documentation

◆ GNUNET_DISK_internal_file_handle_()

int GNUNET_DISK_internal_file_handle_ ( const struct GNUNET_DISK_FileHandle fh,
void *  dst,
size_t  dst_len 
)

Retrieve OS file handle.

Parameters
fhGNUnet file descriptor
dstdestination buffer
dst_lenlength of dst
Returns
GNUNET_OK on success, GNUNET_SYSERR otherwise
Parameters
fhGNUnet file descriptor
dstdestination buffer
dst_lenlength of dst
Returns
GNUNET_OK on success, GNUNET_SYSERR otherwise

Definition at line 2665 of file disk.c.

References GNUNET_DISK_FileHandle::fd, GNUNET_OK, and GNUNET_SYSERR.

Referenced by GNUNET_NETWORK_fdset_handle_set(), and start_process().

2667 {
2668  if (NULL == fh)
2669  return GNUNET_SYSERR;
2670 #ifdef MINGW
2671  if (dst_len < sizeof (HANDLE))
2672  return GNUNET_SYSERR;
2673  *((HANDLE *) dst) = fh->h;
2674 #else
2675  if (dst_len < sizeof (int))
2676  return GNUNET_SYSERR;
2677  *((int *) dst) = fh->fd;
2678 #endif
2679 
2680  return GNUNET_OK;
2681 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:78
#define GNUNET_SYSERR
Definition: gnunet_common.h:79
int fd
File handle on other OSes.
Here is the caller graph for this function: