parrotcode: UNIX IO utility functions | |
Contents | C |
src/io/unix.c - UNIX IO utility functions
This file implements unbuffered, low-level, UNIX-specific functionality. "UNIX" is a generalization, it may be necessary to create separate OS-specific functions for UNIX flavors.
These functions are not part of Parrot's API.
Don't call them directly,
call the PIO_*
macros instead.
Each platform defines the standard set of macros,
which call the correct functions for that platform.
APitUE - W. Richard Stevens, AT&T SFIO, Perl 5 (Nick Ing-Simmons)
Define PARROT_NET_DEVEL
to enable networking.
These could be native extensions but they probably should be here if we wish to make them integrated with the async IO system.
Very minimal stubs for now, maybe someone will run with these.
STRING *Parrot_io_sockaddr_in
Parrot_io_sockaddr_in()
is not part of the layer and so must be extern
.XXX: We can probably just write our own routines (htons()
,
inet_aton()
,
etc.) and take this out of platform specific compilation
PMC *Parrot_io_socket_unix
socket()
to create a socket with the specified address family,
socket type and protocol number.
INTVAL Parrot_io_connect_unix
*io
's socket to address *r
.
INTVAL Parrot_io_bind_unix
*io
's socket to the local address and port specified by *l
.
INTVAL Parrot_io_listen_unix
STREAM
or SEQ
sockets.
ParrotIO *Parrot_io_accept_unix
ParrotIO
socket.
INTVAL Parrot_io_send_unix
*s
to *io
's connected socket.
INTVAL Parrot_io_recv_unix
**s
from *io
's connected socket.
INTVAL Parrot_io_poll_unix
PMC *Parrot_io_pipe_unix
exec
for now.src/io/common.c, src/io/win32.c, src/io/stdio.c, src/io/io_private.h, include/parrot/io_unix.h.
|