Skip Menu |

This queue is for tickets about the POSIX-2008 CPAN distribution.

Report information
The Basics
Id: 123054
Status: resolved
Priority: 0/
Queue: POSIX-2008

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: close() mapping is missing
Currently I need to load both POSIX::2008 *and* POSIX.pm itself if I want to operate low-level file descriptors. I.e.: perl -MFcntl=O_RDONLY -MPOSIX::2008 -MPOSIX -e ' my $fdnum = POSIX::2008::open( ".bashrc", O_RDONLY ) or die "open failed: $!"; POSIX::2008::pread( $fdnum, my $buf, 10, 0 ) or die "pread failed: $!"; my $fdnum = POSIX::close( $fdnum ) # <--- only spot where I need POSIX or die "close failed: $!"; POSIX::2008::write( 1, "$buf...\n" ) or die "STDOUT write failed: $!"; ' Adding close() for completeness would be nice.
Fixed in version 0.16. Note that open() may return 0 as a valid file descriptor, so "open() or die" is not a good idea. You can replace -MFcntl by -MPOSIX::2008=:fcntl if you only need the constants.