This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Include <errno.h> in stdio-common/psiginfo.c
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 24 Apr 2009 11:30:20 -0400
- Subject: Re: PATCH: Include <errno.h> in stdio-common/psiginfo.c
- References: <20090424050055.GA16649@lucon.org>
On Fri, Apr 24, 2009 at 1:00 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> ia64 build failed with
>
> /export/build/gnu/glibc/build-ia64-linux/libc_pic.os: In function
> `psiginfo':
> /net/gnu-6/export/gnu/src/glibc/glibc/stdio-common/psiginfo.c:182:
> undefined reference to `__set_errno'
> collect2: ld returned 1 exit status
> make[3]: *** [/export/build/gnu/glibc/build-ia64-linux/libc.so] Error 1
> make[3]: Leaving directory `/net/gnu-6/export/gnu/src/glibc/glibc'
>
> stdio-common/psiginfo.c has
>
> write_not_cancel (STDERR_FILENO, buf, strlen (buf));
>
> which may use __set_errno. But <errno.h> may not be included. This
> patch fixes it.
This is the wrong patch, write_not_cancel expands to INLINE_SYSCALL,
which is defined in sysdep.h. If you get this build error it means
your targets sysdep.h file forgot to include errno.h and used
__set_errno in the INLINE_SYSCALL.
The correct patch is to add #include <errno.h> to your target sysdep.h
Cheers,
Carlos.