Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Backport some IO enums from newio branch
  • Loading branch information
lizmat committed Nov 14, 2015
1 parent 0825ea0 commit 31d12fb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/core/IO.pm
Expand Up @@ -6,6 +6,32 @@ my role IO {
method umask { state $ = :8( qx/umask/.chomp ) }
}

enum SeekType (
:SeekFromBeginning(0),
:SeekFromCurrent(1),
:SeekFromEnd(2),
);
enum ProtocolFamily (
:PF_LOCAL(0),
:PF_UNIX(1),
:PF_INET(2),
:PF_INET6(3),
:PF_MAX(4),
);
enum SocketType (
:SOCK_PACKET(0),
:SOCK_STREAM(1),
:SOCK_DGRAM(2),
:SOCK_RAW(3),
:SOCK_RDM(4),
:SOCK_SEQPACKET(5),
:SOCK_MAX(6),
);
enum ProtocolType (
:PROTO_TCP(6),
:PROTO_UDP(17),
);

#===============================================================================
# Primitives that may live in a role someday, if we figure out how to do that
# in a sensible and performant way. Until then, these global subs with slightly
Expand Down

0 comments on commit 31d12fb

Please sign in to comment.