[patch] to gdb: portability fix: <sys/file.h>

Michael Sokolov msokolov@ivan.Harhan.ORG
Tue Feb 6 13:53:00 GMT 2001


jtc@redback.com (J.T. Conklin) wrote:

> However, I am somewhat concerned if any one
> changes any other file to use one of the access(2) macros (F_OK, R_OK,
> W_OK, or X_OK) it won't have your fix.

Anyone needing a define that's in different places on different systems should
have logic to include different headers depending on config.h definitions. This
is how it's done in the rest of the Cygnus tree.

> One thing we've done is to provide GDB specific wrappers of header
> files, fixing up nits or deficiencies of different implementations so
> that the body of GDB code doesn't have to deal with them.  I'm
> inclined to think that this falls within that category.  We could
> create a gdb_unistd.h that simply includes unistd.h on systems that
> have that header, but defines the missing bits on others.  We could
> fix up those other gdb configs at the same time.

But this is not a problem of a specific header file being broken that can be
wrappered around, it's just that the definitions of access(2) macros are in
different headers on different systems. I guess the logic for including these
headers could be put in defs.h. This is also consistent with how the rest of
the Cygnus tree handles this.

> Note this isn't a patch rejection.

So could you then approve my patch as a blanket write priv maintainer? Or would
you rather have me add the access(2) macro logic in defs.h?

-- 
Michael Sokolov
Public Service Agent
International Engineering and Science Task Force

1351 VINE AVE APT 27		Phone: +1-714-738-5409
FULLERTON CA 92833-4291 USA	(home office)

E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP)


More information about the Gdb-patches mailing list