Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 44 lines (30 sloc) 0.767 kB
#!/usr/bin/env perl
use strict;
use warnings;
use POSIX;
print <<"END_HEADER";
# DO NOT EDIT THIS FILE.
#
# This file is generated automatically from
# $0
#
# Any changes made here will be lost.
#
END_HEADER
my @errno_values;
my $max_errno_name_len = 0;
foreach my $name (sort grep { /^E[A-Z]+$/ } keys %POSIX::) {
my $code = POSIX->can($name);
next unless $code;
my $value = eval { $code->() };
next unless defined $value;
push @errno_values, [ $name, $value ];
if(length($name) > $max_errno_name_len) {
$max_errno_name_len = length($name);
}
}
my $format = ".macro_const POSIX_%-${max_errno_name_len}s %d\n";
foreach my $pair (@errno_values) {
my ( $name, $value ) = @$pair;
printf $format, $name, $value;
}
Jump to Line
Something went wrong with that request. Please try again.