This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
#ifdef _POSIX_SOURCE, select.h, fileno, fdopen
- From: Rutger Hofman <rutger at cs dot vu dot nl>
- To: eCos Disuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 25 Dec 2008 00:43:26 +0100
- Subject: [ECOS] #ifdef _POSIX_SOURCE, select.h, fileno, fdopen
Good evening list,
eCos sys/select.h has an all-developing #if !defined(_POSIX_SOURCE); if
it is defined, there are no (proto)types for fd_set and friends or select().
If I read the Linux man page, the select types (fd_set) and prototypes
are defined from Posix in sys/select.h, and from sys/time.h,
sys/types.h, unistd.h according to earlier standards. So it would seem
incompatible (at least) that eCos only provides these (proto)types
ifndef _POSIX_SOURCE?
On the other hand, Linux stdio.h has conditional prototypes for fileno()
and fdopen() in stdio.h that depend on a defined _POSIX_SOURCE. eCos has
no conditions on providing these.
I need to compile my application for both Linux and eCos. Now, if I
define _POSIX_SOURCE, I have fileno and fdopen under Linux, but no
select and fd_set under eCos. If I don't define _POSIX_SOURCE, I have
select and fd_set under eCos but no fileno and fdopen under Linux.
Shouldn't eCos define fd_set and select() (also) if _POSIX_SOURCE? And
maybe, shouldn't eCos make providing fileno/fdopen depend on #ifdef
_POSIX_SOURCE?
Rutger
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss