Re: [HACKERS] acl problem in NetBSD/m68k

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: t-ishii(at)sra(dot)co(dot)jp, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] acl problem in NetBSD/m68k
Date: 1999-06-29 05:07:33
Message-ID: 199906290507.BAA05326@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> There are two ways we could attack this: (1) put a "pad" field into
> struct AclItem (prolly two uint8s) to try to ensure that compilers
> would think it is 8 bytes long, or (2) make the size field for aclitem
> in pg_type.h read "sizeof(AclItem)". I think the latter is a better
> long-term solution, because it eliminates having to try to guess
> what a compiler will do with a struct declaration. But there are
> several possible counterarguments:
>
> * It might require patching the scripts that read pg_type.h --- I
> am not sure if they'd work unmodified.
>
> * We'd either need to #include acl.h into pg_type.h or push the
> declarations for AclItem into some more-widely-used header.
>
> * In theory this would represent an initdb change and couldn't
> be applied before 6.6. In practice, Postgres isn't working right
> now on any platform where sizeof(AclItem) != 8, so initdb would
> *not* be needed for any working installation.
>
> I don't think any of these counterarguments is a big deal, but
> maybe someone else will have a different opinion.

My guess is that we are looking at different solutions for 6.5.1 and
6.6. A good argument for a source tree split.

Currently, initdb runs through pg_type.h using sed/awk, so it can't
see any of the sizeof() defines. One hokey solution would be to have
the compile process run a small C program that dumps out the acl size
into a file, and have initdb pick up that. That is a terrible solution,
though. I guess we don't have any other 'struct' data types that need
to know the size of the struct on a give OS. Maybe padding with an
Assert() to make sure it stays at the fixed size we specify is a good
solution.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-06-29 05:13:32 Re: [HACKERS] 6.5.1 status
Previous Message Thomas Lockhart 1999-06-29 04:57:07 Re: [HACKERS] Perl library (was Building Postgres)