From owner-freebsd-questions Fri Apr 2 17:53:38 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id E1D5D151DF for ; Fri, 2 Apr 1999 17:53:36 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.1/8.9.1) id TAA71937; Fri, 2 Apr 1999 19:53:14 -0600 (CST) Date: Fri, 2 Apr 1999 19:53:13 -0600 From: Dan Nelson To: Glenn Johnson Cc: questions@FreeBSD.ORG Subject: Re: errno definitions Message-ID: <19990402195313.A71842@dan.emsphone.com> References: <19990402152609.A54392@symbion.srrc.usda.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <19990402152609.A54392@symbion.srrc.usda.gov>; from "Glenn Johnson" on Fri Apr 2 15:26:09 GMT 1999 X-OS: FreeBSD 3.1-STABLE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Apr 02), Glenn Johnson said: > I am trying to compile some code (not mine, but it is proprietary) > that compiles on Linux and Irix, but not on FreeBSD. The problem I am > running into is that the program makes use of the following > definitions from errno.h: > > EMULTIHOP and ENOLINK. > > I looked in a Linux header file and found the following > definitions: > > #define ENOLINK 67 /* Link has been severed */ > #define EMULTIHOP 72 /* Multihop attempted */ > > The numbers in the FreeBSD errno.h file go up to 86. So I was > thinking I could construct a local header file with these definitions > using 87 and 88. Or can someone recommend equivalent functions that I > could replace these definitions with? Simply wrap the offending code with "#ifdef ENOLINK ... #endif", since no FreeBSD function will ever return those errors, so you don't have to write code to handle those error cases. If you try and add those two definitions, you will end up with undefined behaviour, since on FreeBSD, errnos 67 and 72 are EPROCLIM and EBADRPC, and your code could end up doing "link has been severed" recovery code when FreeBSD has actually returned "too many processes". -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message