Move errno.h to it's correct place
Adjust Errors.h to use errno.h for the posix error codes add first stab at limits.h, albeit not using the gcc headers at present for intel. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@88 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* errno.h
|
||||
*
|
||||
* POSIX style error codes.
|
||||
* Be values used where required to keep compatibility.
|
||||
*/
|
||||
|
||||
#ifndef _POSIX_ERRNO_H
|
||||
#define _POSIX_ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* XXX - this really belongs in limits.h, but as we don't have one
|
||||
* yet it's here so we can build.
|
||||
* XXX - move me!
|
||||
*/
|
||||
/* Minimum's */
|
||||
#ifndef LONG_MIN
|
||||
#define LONG_MIN (-2147483647L-1)
|
||||
#endif
|
||||
|
||||
/* XXX - Fix this once TLS works */
|
||||
extern int errno;
|
||||
|
||||
/* We're defining values based on the values that Be used, hence
|
||||
* the starting point at + 0x7000
|
||||
*/
|
||||
#define POSIX_ERROR_START LONG_MIN + 0x7000
|
||||
|
||||
/* The basic error codes that don't have a B_ equivalent
|
||||
*
|
||||
* NB when adding codes make sure that the Be Errors.h didn't
|
||||
* define a value or it needs to go in the bottom section and
|
||||
* have an identical value assigned.
|
||||
* NB new values just go on the bottom.
|
||||
*/
|
||||
enum {
|
||||
E2BIG = POSIX_ERROR_START + 1,
|
||||
ECHILD,
|
||||
EDEADLK,
|
||||
EFBIG,
|
||||
EMLINK,
|
||||
ENFILE,
|
||||
ENODEV,
|
||||
ENOLCK,
|
||||
ENOSYS,
|
||||
ENOTTY, /* +10 */
|
||||
ENXIO,
|
||||
ESPIPE,
|
||||
ESRCH,
|
||||
EFPOS,
|
||||
ESIGPARM,
|
||||
EDOM,
|
||||
ERANGE,
|
||||
EPROTOTYPE,
|
||||
EPROTONOSUPPORT,
|
||||
EPFNOSUPPORT, /* +20 */
|
||||
EAFNOSUPPORT,
|
||||
EADDRINUSE,
|
||||
EADDRNOTAVAIL,
|
||||
ENETDOWN,
|
||||
ENETUNREACH,
|
||||
ENETRESET,
|
||||
ECONNABORTED,
|
||||
ECONNRESET,
|
||||
EISCONN,
|
||||
ENOTCONN, /* +30 */
|
||||
ESHUTDOWN,
|
||||
ECONNREFUSED,
|
||||
EHOSTUNREACH,
|
||||
ENOPROTOOPT,
|
||||
ENOBUFS,
|
||||
EINPROGRESS,
|
||||
EALREADY,
|
||||
EILSEQ,
|
||||
ENOMSG,
|
||||
ESTALE, /* +40 */
|
||||
EOVERFLOW,
|
||||
EMSGSIZE,
|
||||
EOPNOTSUPP,
|
||||
ENOTSOCK,
|
||||
|
||||
/* These are additional to the Be ones */
|
||||
EBADMSG,
|
||||
ECANCELLED,
|
||||
EDESTADDRREQ,
|
||||
EDQUOT,
|
||||
EHOSTDOWN,
|
||||
EIDRM, /* +50 */
|
||||
EISDIR,
|
||||
EMULTIHOP,
|
||||
ENODATA,
|
||||
ENOLINK,
|
||||
ENOSR,
|
||||
ENOSTR,
|
||||
EPROTO,
|
||||
EPROTOOPT,
|
||||
ETIME,
|
||||
EFTYPE
|
||||
};
|
||||
|
||||
/*
|
||||
* Errors with Be equivalents
|
||||
*/
|
||||
|
||||
/* TODO: add comments showing what the equivalent Be errors are... */
|
||||
|
||||
/* NB - These have strange values to be the same as the Be values... */
|
||||
|
||||
/* General errors */
|
||||
enum {
|
||||
ENOMEM = LONG_MIN,
|
||||
EIO,
|
||||
EACCES,
|
||||
EINVAL = LONG_MIN + 5,
|
||||
ETIMEDOUT = LONG_MIN + 9,
|
||||
EINTR,
|
||||
EWOULDBLOCK,
|
||||
EAGAIN = EWOULDBLOCK,
|
||||
EBUSY = LONG_MIN + 14,
|
||||
EPERM
|
||||
};
|
||||
|
||||
/* Storage kit/File system errors */
|
||||
enum {
|
||||
EBADF = LONG_MIN + 0x6000,
|
||||
EEXIST = EBADF + 2,
|
||||
ENOENT,
|
||||
ENAMETOOLONG,
|
||||
ENOTDIR,
|
||||
ENOTEMPTY,
|
||||
ENOSPC,
|
||||
EROFS,
|
||||
EMFILE,
|
||||
EXDEV,
|
||||
ELOOP,
|
||||
EPIPE
|
||||
};
|
||||
|
||||
#define ENOEXEC LONG_MIN + 0x1302
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* "C" */
|
||||
#endif
|
||||
|
||||
#endif /* _POSIX_ERRNO_H */
|
||||
@@ -0,0 +1,48 @@
|
||||
/* protocols.h
|
||||
* The various protocols we're likely to come across as
|
||||
* they're identified in the type fields of packets...
|
||||
*/
|
||||
|
||||
#include "netinet/in.h"
|
||||
|
||||
#ifndef OBOS_PROTOCOLS_H
|
||||
#define OBOS_PROTOCOLS_H
|
||||
|
||||
/* define some protocol numbers unique to ethernet */
|
||||
enum {
|
||||
ETHER_IPV4 = 0x0800,
|
||||
ETHER_ARP = 0x0806,
|
||||
ETHER_RARP = 0x8035,
|
||||
ETHER_ATALK = 0x809b, /* Appletalk */
|
||||
ETHER_SNMP = 0x814c, /* SNMP */
|
||||
ETHER_IPV6 = 0x86dd, /* IPv6 */
|
||||
ETHER_PPPOE_DISC = 0x8863, /* PPPoE Discovery */
|
||||
ETHER_PPPOE_SESS = 0x8864 /* PPPoE Session */
|
||||
};
|
||||
|
||||
/* these are used when assigning slots in the protocol table, so they
|
||||
* should tie in with IP numbers wherever possible, with other
|
||||
* protocols fitting in.
|
||||
* These are used in the module definitions.
|
||||
*/
|
||||
enum {
|
||||
NS_IPV4 = IPPROTO_IP,
|
||||
NS_ICMP = IPPROTO_ICMP,
|
||||
NS_IGMP = IPPROTO_IGMP,
|
||||
NS_TCP = IPPROTO_TCP,
|
||||
NS_UDP = IPPROTO_UDP,
|
||||
NS_ETHER=200,
|
||||
NS_IPV6,
|
||||
NS_ATALK,
|
||||
NS_ARP,
|
||||
NS_RARP,
|
||||
NS_PPPOE,
|
||||
NS_SERIAL,
|
||||
NS_LOOP,
|
||||
NS_SOCKET,
|
||||
NS_ROUTE
|
||||
};
|
||||
|
||||
|
||||
#endif /* OBOS_PROTOCOLS_H */
|
||||
|
||||
Reference in New Issue
Block a user