Skip to content

Commit

Permalink
Make win32 tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof committed Jan 11, 2011
1 parent 688366d commit 770403b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/parrot/io.h
Expand Up @@ -45,7 +45,7 @@
Parrot_io_open((interp), (file), (flags))
#define PIO_OPEN_PIPE(interp, file, flags, pid) \
Parrot_io_open_pipe((interp), (file), (flags), (pid))
#define PIO_DUP(interp, handle) (PIOHANDLE)dup((int)(handle))
#define PIO_DUP(interp, handle) Parrot_io_dup((interp), (handle))
#define PIO_CLOSE(interp, handle) Parrot_io_close((interp), (handle))
#define PIO_CLOSE_PIOHANDLE(interp, handle) Parrot_io_close_piohandle((interp), (handle))
#define PIO_PIPE_WAIT(interp, pid) Parrot_io_waitpid((interp), (pid))
Expand Down
3 changes: 2 additions & 1 deletion include/parrot/platform_interface.h
Expand Up @@ -62,7 +62,8 @@ typedef off_t PIOOFF_T;

PIOHANDLE Parrot_io_std_os_handle(PARROT_INTERP, INTVAL fileno);
PIOHANDLE Parrot_io_open(PARROT_INTERP, ARGIN(STRING *path), INTVAL flags);
INTVAL Parrot_io_close(PARROT_INTERP, PIOHANDLE file_descriptor);
PIOHANDLE Parrot_io_dup(PARROT_INTERP, PIOHANDLE handle);
INTVAL Parrot_io_close(PARROT_INTERP, PIOHANDLE handle);
INTVAL Parrot_io_close_piohandle(PARROT_INTERP, PIOHANDLE handle);
INTVAL Parrot_io_waitpid(PARROT_INTERP, INTVAL pid);
INTVAL Parrot_io_is_tty(PARROT_INTERP, PIOHANDLE fd);
Expand Down
17 changes: 17 additions & 0 deletions src/platform/generic/io.c
Expand Up @@ -175,6 +175,23 @@ Parrot_io_open(PARROT_INTERP, ARGIN(STRING *path), INTVAL flags)
return fd;
}

/*
=item C<PIOHANDLE Parrot_io_dup(PARROT_INTERP, PIOHANDLE handle)>
Duplicates file handle C<handle>.
=cut
*/

PARROT_WARN_UNUSED_RESULT
PIOHANDLE
Parrot_io_dup(PARROT_INTERP, PIOHANDLE handle)
{
return dup(handle);
}

#if PARROT_ASYNC_DEVEL

/*
Expand Down

0 comments on commit 770403b

Please sign in to comment.