This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


>>>>> "Michael" == Michael Sokolov <msokolov@ivan.Harhan.ORG> writes:
Michael> The patch below is a portability fix for gdb. corelow.c uses
Michael> F_OK and currently fails to compile on 4.3BSD host because it
Michael> doesn't include <sys/file.h>, where this constant is defined
Michael> on 4.3BSD. The patch below makes it include <sys/file.h> if
Michael> present, and adds the configure check for it. OK to commit?

There are some configs with xm-*.h headers that define F_OK, etc.  I
don't think that's a satisfactory solution considering we want to
obsolete as much as we can of these with autoconf tests.

In that sense your change is better than what has been traditionally
done in this situation.  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.

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.

Note this isn't a patch rejection.  I'm not in a position to do that.
So before you go about and do this work, make sure there is consensus
that this route is the way to go.

        --jtc

-- 
J.T. Conklin
RedBack Networks

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]