The friendly Operating System for the Internet of Things
POSIX wrapper for RIOT

POSIX header files. More...

Detailed Description

See also
The Open Group Specifications Issue 7

Modules

 POSIX semaphores
 
 POSIX sockets
 POSIX socket wrapper of RIOT's Sock API.
 
 POSIX threads
 POSIX conforming multi-threading features.
 

Files

file  fd.h
 Unifies diverse identifiers of RIOT to POSIX like file descriptors.
 
file  uio.h
 libc header for scatter/gather I/O
 
file  fcntl.h
 POSIX compatible fcntl.h definitions.
 

Data Structures

struct  fd_t
 File descriptor table. More...
 
struct  iovec
 Structure for scatter/gather I/O. More...
 

Functions

int fd_init (void)
 Initializes file descriptors. More...
 
int fd_new (int internal_fd, ssize_t(*internal_read)(int, void *, size_t), ssize_t(*internal_write)(int, const void *, size_t), int(*internal_close)(int))
 Creates a new file descriptor. More...
 
fd_tfd_get (int fd)
 Gets the file descriptor table entry associated with file descriptor fd. More...
 
void fd_destroy (int fd)
 Removes file descriptor table entry associated with fd from table. More...
 

Function Documentation

void fd_destroy ( int  fd)
Parameters
[in]fdA POSIX-like file descriptor.
fd_t* fd_get ( int  fd)
Parameters
[in]fdA POSIX-like file descriptor.
Returns
The file descriptor table entry associated with file descriptor fd* or NULL if there is non.
int fd_init ( void  )
Returns
maximum number of available file descriptors.
int fd_new ( int  internal_fd,
ssize_t(*)(int, void *, size_t)  internal_read,
ssize_t(*)(int, const void *, size_t)  internal_write,
int(*)(int)  internal_close 
)
Parameters
[in]internal_fdRIOT-internal identifier for the new FD.
[in]internal_readFunction to read from new FD.
[in]internal_writeFunction to write into new FD.
[in]internal_closeFunction to close new FD.
Returns
0 on success, -1 otherwise. errno is set accordingly.