Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 25 Aug 2005 23:46:38 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Cc: Samuel Thibault , dave AT mielke DOT cc Subject: Re: strerror(), errno and syslog() Message-ID: <20050825214638.GX17452@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, Samuel Thibault , dave AT mielke DOT cc References: <20050825213422 DOT GQ7662 AT bouh DOT ens-lyon DOT fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050825213422.GQ7662@bouh.ens-lyon.fr> User-Agent: Mutt/1.4.2i On Aug 25 23:34, Samuel Thibault wrote: > Hi, > > This crashes (yes it's odd code, but it shouldn't crash): > > #include > #include > > int main(void) { > errno = -1; > syslog(LOG_ERR,"foo"); > } > > Indeed, one of the first things that vsyslog does is > > char *errtext = strerror (get_errno ()); > int errlen = strlen (errtext); > > And it happens that the current implementation of strerror() returns > NULL on invalid errno. This is not posix compliant: posix says that This has been fixed a week ago. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/