Обсуждение: Small patch for Hurd
This patch is because Hurd does not support NOFILE. It is against current cvs. The Debian bug report says, "The upstream source makes use of NOFILE unconditionalized. As the Hurd doesn't have an arbitrary limit on the number of open files, this is not defined. But _SC_OPEN_MAX works fine and returns 1024 (applications can increase this as they want), so I suggest the below diff. Please forward this upstream, too." *** pgsql.orig/src/backend/storage/file/fd.c Fri Aug 3 16:28:46 2001 --- pgsql/src/backend/storage/file/fd.c Fri Aug 3 16:29:19 2001 *************** *** 290,297 **** --- 290,302 ---- no_files = sysconf(_SC_OPEN_MAX); if (no_files == -1) { + # tweak for Hurd, which does not support NOFILE + #ifdef NOFILE elog(DEBUG, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf(); using %d", NOFILE); no_files = (long) NOFILE; + #else + elog(FATAL, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf() and NOFILE is undefined"); + #endif } #endif This report was from Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-boch. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Love is patient, love is kind. It does not envy, it does not boast, it isnot proud. It is not rude, it is not self seeking, it is not easily angered, it keeps no record of wrongs. Lovedoes not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, alwaysperseveres." I Corinthians 13:4-7
Your patch has been added to the PostgreSQL unapplied patches list at: http://candle.pha.pa.us/cgi-bin/pgpatches I will try to apply it within the next 48 hours. > This patch is because Hurd does not support NOFILE. It is against current > cvs. > > The Debian bug report says, "The upstream source makes use of NOFILE > unconditionalized. As the Hurd doesn't have an arbitrary limit on the > number of open files, this is not defined. But _SC_OPEN_MAX works fine > and returns 1024 (applications can increase this as they want), so I > suggest the below diff. Please forward this upstream, too." > > > *** pgsql.orig/src/backend/storage/file/fd.c Fri Aug 3 16:28:46 2001 > --- pgsql/src/backend/storage/file/fd.c Fri Aug 3 16:29:19 2001 > *************** > *** 290,297 **** > --- 290,302 ---- > no_files = sysconf(_SC_OPEN_MAX); > if (no_files == -1) > { > + # tweak for Hurd, which does not support NOFILE > + #ifdef NOFILE > elog(DEBUG, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf(); using > %d", NOFILE); > no_files = (long) NOFILE; > + #else > + elog(FATAL, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf() and > NOFILE is undefined"); > + #endif > } > #endif > > > > This report was from Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-boch. > > -- > Oliver Elphick Oliver.Elphick@lfix.co.uk > Isle of Wight http://www.lfix.co.uk/oliver > PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C > ======================================== > "Love is patient, love is kind. It does not envy, it > does not boast, it is not proud. It is not rude, it is > not self seeking, it is not easily angered, it keeps > no record of wrongs. Love does not delight in evil but > rejoices with the truth. It always protects, always > trusts, always hopes, always perseveres." > I Corinthians 13:4-7 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
Patch applied. Thanks. > This patch is because Hurd does not support NOFILE. It is against current > cvs. > > The Debian bug report says, "The upstream source makes use of NOFILE > unconditionalized. As the Hurd doesn't have an arbitrary limit on the > number of open files, this is not defined. But _SC_OPEN_MAX works fine > and returns 1024 (applications can increase this as they want), so I > suggest the below diff. Please forward this upstream, too." > > > *** pgsql.orig/src/backend/storage/file/fd.c Fri Aug 3 16:28:46 2001 > --- pgsql/src/backend/storage/file/fd.c Fri Aug 3 16:29:19 2001 > *************** > *** 290,297 **** > --- 290,302 ---- > no_files = sysconf(_SC_OPEN_MAX); > if (no_files == -1) > { > + # tweak for Hurd, which does not support NOFILE > + #ifdef NOFILE > elog(DEBUG, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf(); using > %d", NOFILE); > no_files = (long) NOFILE; > + #else > + elog(FATAL, "pg_nofile: Unable to get _SC_OPEN_MAX using sysconf() and > NOFILE is undefined"); > + #endif > } > #endif > > > > This report was from Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-boch. > > -- > Oliver Elphick Oliver.Elphick@lfix.co.uk > Isle of Wight http://www.lfix.co.uk/oliver > PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C > ======================================== > "Love is patient, love is kind. It does not envy, it > does not boast, it is not proud. It is not rude, it is > not self seeking, it is not easily angered, it keeps > no record of wrongs. Love does not delight in evil but > rejoices with the truth. It always protects, always > trusts, always hopes, always perseveres." > I Corinthians 13:4-7 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026