summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane1999-10-25 03:08:03 +0000
committerTom Lane1999-10-25 03:08:03 +0000
commit51f62d505e2aba66bf7870c7bd005cd32e7d0953 (patch)
tree127e7cbbf6679dbc2e3cfd08786ab88a7a801f50 /src/include
parent8a17ed63359325c567694fdd378e71803a53cc73 (diff)
Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really convinced that there ought to be a configure-time test to set the value, go right ahead ... but I think it's a waste of time.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/config.h.in12
-rw-r--r--src/include/port/sco.h6
-rw-r--r--src/include/port/win32.h3
-rw-r--r--src/include/postgres.h7
-rw-r--r--src/include/utils/dynamic_loader.h5
5 files changed, 16 insertions, 17 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in
index e36220e940c..698526e7da2 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -204,6 +204,18 @@
/* #define OLD_REWRITE */
/*
+ * MAXPGPATH: standard size of a pathname buffer in Postgres (hence,
+ * maximum usable pathname length is one less).
+ *
+ * We'd use a standard system header symbol for this, if there weren't
+ * so many to choose from: MAXPATHLEN, _POSIX_PATH_MAX, MAX_PATH, PATH_MAX
+ * are all defined by different "standards", and often have different
+ * values on the same platform! So we just punt and use a reasonably
+ * generous setting here.
+ */
+#define MAXPGPATH 1024
+
+/*
*------------------------------------------------------------------------
* The following is set using configure.
*------------------------------------------------------------------------
diff --git a/src/include/port/sco.h b/src/include/port/sco.h
index 074c6533979..daba7b5a708 100644
--- a/src/include/port/sco.h
+++ b/src/include/port/sco.h
@@ -1,9 +1,3 @@
-#include <limits.h> /* For _POSIX_PATH_MAX */
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN _POSIX_PATH_MAX
-#endif
-
#ifndef NOFILE
#define NOFILE NOFILES_MIN
#endif
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 7e21816b2b6..59bd010afc8 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -2,6 +2,3 @@
#define NEED_SIG_JMP
#define USES_WINSOCK
#define NOFILE 100
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 250
-#endif
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 5835f444866..ddc84007332 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1995, Regents of the University of California
*
- * $Id: postgres.h,v 1.27 1999/10/23 03:13:30 tgl Exp $
+ * $Id: postgres.h,v 1.28 1999/10/25 03:07:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,7 +28,7 @@
* 2) varlena and array types
* 3) TransactionId and CommandId
* 4) genbki macros used by catalog/pg_xxx.h files
- * 5) random CSIGNBIT, MAXPGPATH, STATUS macros
+ * 5) random stuff
*
* ----------------------------------------------------------------
*/
@@ -158,9 +158,6 @@ typedef uint32 CommandId;
/* msb for char */
#define CSIGNBIT (0x80)
-/* this should probably be somewhere else */
-#define MAXPGPATH 128
-
#define STATUS_OK (0)
#define STATUS_ERROR (-1)
#define STATUS_NOT_FOUND (-2)
diff --git a/src/include/utils/dynamic_loader.h b/src/include/utils/dynamic_loader.h
index 78d74966c7f..fa2acd226ab 100644
--- a/src/include/utils/dynamic_loader.h
+++ b/src/include/utils/dynamic_loader.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dynamic_loader.h,v 1.12 1999/07/15 23:04:21 momjian Exp $
+ * $Id: dynamic_loader.h,v 1.13 1999/10/25 03:07:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -14,7 +14,6 @@
#define DYNAMIC_LOADER_H
#include <sys/types.h>
-#include <sys/param.h> /* For MAXPATHLEN */
/* we need this include because port files use them */
#include "postgres.h"
@@ -30,7 +29,7 @@
typedef struct df_files
{
- char filename[MAXPATHLEN]; /* Full pathname of file */
+ char filename[MAXPGPATH]; /* Full pathname of file */
dev_t device; /* Device file is on */
ino_t inode; /* Inode number of file */
void *handle; /* a handle for pg_dl* functions */