package ZeusOS;

# Defines various platform specific or OS specific constants for our
# miniperl

# Useful constants
*ARCH = \"sparc-sun-solaris2.6";

*AF_UNIX     = \1;
*AF_INET     = \2;
*SOCK_DGRAM  = \1;
*SOCK_STREAM = \2;
*IPPROTO_TCP = \6;

*FD_CLOEXEC  = \1;
*F_DUPFD     = \0;
*F_GETFD     = \1;
*F_GETFL     = \3;
*F_GETLK     = \14;
*F_RDLCK     = \1;
*F_SETFD     = \2;
*F_SETFL     = \4;
*F_SETLK     = \6;
*F_SETLKW    = \7;
*F_UNLCK     = \3;
*F_WRLCK     = \2;
*O_APPEND    = \8;
*O_CREAT     = \256;
*O_EXCL      = \1024;
*O_NDELAY    = \4;
*O_NOCTTY    = \2048;
*O_NONBLOCK  = \128;
*O_RDONLY    = \0;
*O_RDWR      = \2;
*O_TRUNC     = \512;
*O_WRONLY    = \1;

# Useful functions
# (port,ip) -> sockaddr
sub pack_sockaddr_in { pack( 'S n a4 x8', $AF_INET, @_ ); }

# filename -> sockaddr
sub pack_sockaddr_un { pack( 'S a*', $AF_UNIX, @_ ); }

1;
