Description: Changes needed for Hurd-i1386 support
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2020-12-08
Forwarded: no

Index: cctools-7.1.2/work_queue/src/work_queue.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue.c
+++ cctools-7.1.2/work_queue/src/work_queue.c
@@ -66,6 +66,10 @@ The following major problems must be fix
 #include <string.h>
 #include <time.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 // The default tasks capacity reported before information is available.
 // Default capacity also implies 1 core, 1024 MB of disk and 512 memory per task.
 #define WORK_QUEUE_DEFAULT_CAPACITY_TASKS 10
Index: cctools-7.1.2/work_queue/src/work_queue_process.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue_process.c
+++ cctools-7.1.2/work_queue/src/work_queue_process.c
@@ -29,6 +29,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #define SMALL_BUFFER_SIZE 256
 #define MAX_BUFFER_SIZE 4096
 #define DEFAULT_WORK_DIR "/home/worker"
Index: cctools-7.1.2/work_queue/src/work_queue_worker.c
===================================================================
--- cctools-7.1.2.orig/work_queue/src/work_queue_worker.c
+++ cctools-7.1.2/work_queue/src/work_queue_worker.c
@@ -66,6 +66,10 @@ See the file COPYING for details.
 #include <sys/utsname.h>
 #include <sys/wait.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 typedef enum {
 	WORKER_MODE_WORKER,
 	WORKER_MODE_FOREMAN
Index: cctools-7.1.2/resource_monitor/src/resource_monitor.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/resource_monitor.c
+++ cctools-7.1.2/resource_monitor/src/resource_monitor.c
@@ -159,6 +159,10 @@ See the file COPYING for details.
 #include <sys/ioctl.h>
 #endif
 
+#ifndef PATH_MAX // Not defined on Hurd
+#define PATH_MAX 1024
+#endif
+
 #include "rmonitor_helper_comm.h"
 #include "rmonitor_piggyback.h"
 
Index: cctools-7.1.2/resource_monitor/src/resource_monitor_histograms.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/resource_monitor_histograms.c
+++ cctools-7.1.2/resource_monitor/src/resource_monitor_histograms.c
@@ -19,6 +19,10 @@ See the file COPYING for details.
 
 #define MAX_LINE 1024
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX MAX_LINE
+#endif
+
 #define OUTLIER_DIR "outliers"
 #define OUTLIER_N    5
 
Index: cctools-7.1.2/resource_monitor/src/rmonitor_helper_comm.c
===================================================================
--- cctools-7.1.2.orig/resource_monitor/src/rmonitor_helper_comm.c
+++ cctools-7.1.2/resource_monitor/src/rmonitor_helper_comm.c
@@ -25,6 +25,10 @@ See the file COPYING for details.
 
 #include "rmonitor_helper_comm.h"
 
+#ifndef PATH_MAX // Not defined on Hurd
+#define PATH_MAX 1024
+#endif
+
 #include "debug.h"
 //#define debug fprintf
 //#define D_RMON stderr
Index: cctools-7.1.2/makeflow/src/dag_visitors.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/dag_visitors.c
+++ cctools-7.1.2/makeflow/src/dag_visitors.c
@@ -35,6 +35,9 @@ See the file COPYING for details.
 #include "dag_visitors.h"
 #include "rmsummary.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
 /*
  * BUG: Error handling is not very good.
  * BUG: Integrate more with dttools (use DEBUG, etc.)
Index: cctools-7.1.2/makeflow/src/makeflow_analyze.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_analyze.c
+++ cctools-7.1.2/makeflow/src/makeflow_analyze.c
@@ -47,6 +47,10 @@ See the file COPYING for details.
 #include "dag_visitors.h"
 #include "parser.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 /* Display options */
 enum { SHOW_INPUT_FILES = 2,
 	   SHOW_OUTPUT_FILES,
Index: cctools-7.1.2/makeflow/src/makeflow_linker.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_linker.c
+++ cctools-7.1.2/makeflow/src/makeflow_linker.c
@@ -25,6 +25,10 @@ See the file COPYING for details.
 #include "stringtools.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define MAKEFLOW_PATH "makeflow_analyze"
 #define MAKEFLOW_BUNDLE_FLAG "-b"
 
Index: cctools-7.1.2/makeflow/src/makeflow_log.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_log.c
+++ cctools-7.1.2/makeflow/src/makeflow_log.c
@@ -23,6 +23,10 @@ See the file COPYING for details.
 #include <string.h>
 #include <errno.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define MAX_BUFFER_SIZE 4096
 
 /*
Index: cctools-7.1.2/makeflow/src/makeflow_mounts.c
===================================================================
--- cctools-7.1.2.orig/makeflow/src/makeflow_mounts.c
+++ cctools-7.1.2/makeflow/src/makeflow_mounts.c
@@ -32,6 +32,10 @@ See the file COPYING for details.
 #include "unlink_recursive.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define HTTP_TIMEOUT 300
 
 /* create_link creates a link from link_name to link_target.
Index: cctools-7.1.2/grow/src/grow_fuse.c
===================================================================
--- cctools-7.1.2.orig/grow/src/grow_fuse.c
+++ cctools-7.1.2/grow/src/grow_fuse.c
@@ -26,6 +26,10 @@
 #include "copy_stream.h"
 #include "jx_pretty_print.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef O_PATH
 #define O_PATH O_RDONLY
 #endif
Index: cctools-7.1.2/dttools/src/auth_ticket.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/auth_ticket.c
+++ cctools-7.1.2/dttools/src/auth_ticket.c
@@ -20,6 +20,10 @@ See the file COPYING for details.
 #include "sort_dir.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #include <sys/stat.h>
 
 #include <assert.h>
Index: cctools-7.1.2/parrot/src/pfs_service_ext.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_service_ext.cc
+++ cctools-7.1.2/parrot/src/pfs_service_ext.cc
@@ -16,6 +16,10 @@ See the file COPYING for details.
 #include <sys/types.h>
 #include <dirent.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #include "pfs_service.h"
 
 extern "C" {
Index: cctools-7.1.2/parrot/test/TR_parrot_mmap.sh
===================================================================
--- cctools-7.1.2.orig/parrot/test/TR_parrot_mmap.sh
+++ cctools-7.1.2/parrot/test/TR_parrot_mmap.sh
@@ -21,6 +21,10 @@ prepare()
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 void dumpmaps (void)
 {
 	char buf[65536] = "";
Index: cctools-7.1.2/batch_job/src/batch_job_internal.h
===================================================================
--- cctools-7.1.2.orig/batch_job/src/batch_job_internal.h
+++ cctools-7.1.2/batch_job/src/batch_job_internal.h
@@ -19,6 +19,10 @@ See the file COPYING for details.
 #include "hash_table.h"
 #include "itable.h"
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #define BATCH_JOB_LINE_MAX 8192
 
 struct batch_queue_module {
Index: cctools-7.1.2/batch_job/src/work_queue_factory.c
===================================================================
--- cctools-7.1.2.orig/batch_job/src/work_queue_factory.c
+++ cctools-7.1.2/batch_job/src/work_queue_factory.c
@@ -46,6 +46,10 @@ See the file COPYING for details.
 #include <unistd.h>
 #include <signal.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define CCTOOLS_RUNOS_PATH "/afs/crc.nd.edu/group/ccl/software/runos/runos.py"
 #define CCTOOLS_VC3_BUILDER_PATH "/afs/crc.nd.edu/group/ccl/software/vc3-builder-src/vc3-builder"
 
Index: cctools-7.1.2/chirp/src/chirp_group.h
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_group.h
+++ cctools-7.1.2/chirp/src/chirp_group.h
@@ -10,6 +10,10 @@ See the file COPYING for details.
 
 #include <limits.h>
 
+#ifndef PATH_MAX // Hurd
+#define MATH_MAX 1024
+#endif
+
 extern char chirp_group_base_url[PATH_MAX];
 extern int  chirp_group_cache_time;
 
Index: cctools-7.1.2/chirp/src/chirp_acl.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_acl.c
+++ cctools-7.1.2/chirp/src/chirp_acl.c
@@ -31,6 +31,10 @@ See the file COPYING for details.
 #include <fcntl.h>
 #include <dirent.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 const char *chirp_super_user = "";
 
 static int read_only_mode = 0;
Index: cctools-7.1.2/chirp/src/confuga_adm.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_adm.c
+++ cctools-7.1.2/chirp/src/confuga_adm.c
@@ -16,6 +16,10 @@ See the file COPYING for details.
 #include <limits.h>
 #include <string.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 static int process (confuga *C, int argc, char *argv[])
 {
 	int rc;
Index: cctools-7.1.2/chirp/src/chirp_job.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_job.c
+++ cctools-7.1.2/chirp/src/chirp_job.c
@@ -40,6 +40,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define IMMUTABLE_JOB_INSERT(T) \
 		"CREATE TRIGGER " T "ImmutableJobI BEFORE INSERT ON " T " FOR EACH ROW" \
 		"    BEGIN" \
Index: cctools-7.1.2/chirp/src/chirp_server.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_server.c
+++ cctools-7.1.2/chirp/src/chirp_server.c
@@ -75,6 +75,10 @@
 
 #define GC_TIMEOUT  (86400)
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 /* The maximum chunk of memory the server will allocate to handle I/O */
 #define MAX_BUFFER_SIZE (16*1024*1024)
 
Index: cctools-7.1.2/chirp/src/confuga.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga.c
+++ cctools-7.1.2/chirp/src/confuga.c
@@ -52,6 +52,10 @@ See the file COPYING for details.
 #include <string.h>
 #include <time.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #ifdef CCTOOLS_OPSYS_DARWIN
 	/* Cygwin does not have 64-bit I/O, while FreeBSD/Darwin has it by default. */
 #	define stat64 stat
Index: cctools-7.1.2/chirp/src/confuga_gc.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_gc.c
+++ cctools-7.1.2/chirp/src/confuga_gc.c
@@ -13,6 +13,10 @@
 
 #include <assert.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef O_CLOEXEC
 #	define O_CLOEXEC 0
 #endif
Index: cctools-7.1.2/chirp/src/confuga_namespace.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_namespace.c
+++ cctools-7.1.2/chirp/src/confuga_namespace.c
@@ -32,6 +32,10 @@ See the file COPYING for details.
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifdef CCTOOLS_OPSYS_DARWIN
 	/* Cygwin does not have 64-bit I/O, while FreeBSD/Darwin has it by default. */
 #	define stat64 stat
Index: cctools-7.1.2/dttools/src/elfheader.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/elfheader.c
+++ cctools-7.1.2/dttools/src/elfheader.c
@@ -31,6 +31,10 @@ typedef int64_t  Elf32_Sxword;
 typedef uint64_t Elf64_Xword;
 typedef int64_t  Elf64_Sxword;
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #define EI_NIDENT 16
 #define ELFMAG "\x7f" "ELF"
 
@@ -47,6 +51,10 @@ typedef int64_t  Elf64_Sxword;
 #define ELFCLASS32 1
 #define ELFCLASS64 2
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 typedef struct {
 	unsigned char e_ident[EI_NIDENT];
 	Elf32_Half e_type;
Index: cctools-7.1.2/dttools/src/elfheader.h
===================================================================
--- cctools-7.1.2.orig/dttools/src/elfheader.h
+++ cctools-7.1.2/dttools/src/elfheader.h
@@ -9,6 +9,10 @@ See the file COPYING for details.
 
 #include <limits.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 /** Get the interpreter (PT_INTERP) for the executable.
  *
  * @param fd The open file descriptor to the executable.
Index: cctools-7.1.2/chirp/src/chirp_fs_local_scheduler.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_fs_local_scheduler.c
+++ cctools-7.1.2/chirp/src/chirp_fs_local_scheduler.c
@@ -56,6 +56,10 @@
 #include <stdint.h>
 #include <string.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #ifndef O_CLOEXEC
 #	define O_CLOEXEC 0
 #endif
Index: cctools-7.1.2/chirp/src/confuga_node.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_node.c
+++ cctools-7.1.2/chirp/src/confuga_node.c
@@ -28,6 +28,10 @@ See the file COPYING for details.
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 #define STOPTIME_SHORT  (time(NULL)+5)
 #define TICKET_DURATION (12*60*60)
 
Index: cctools-7.1.2/chirp/src/chirp_filesystem.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_filesystem.c
+++ cctools-7.1.2/chirp/src/chirp_filesystem.c
@@ -34,6 +34,10 @@ See the file COPYING for details.
 #include <stdio.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define CHIRP_FILESYSTEM_BUFFER  65536
 
 struct chirp_filesystem *cfs = NULL;
Index: cctools-7.1.2/chirp/src/chirp_group.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_group.c
+++ cctools-7.1.2/chirp/src/chirp_group.c
@@ -17,6 +17,9 @@ See the file COPYING for details.
 #include <errno.h>
 #include <sys/stat.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
 
 extern char chirp_transient_path[PATH_MAX];
 
Index: cctools-7.1.2/dttools/src/memfdexe.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/memfdexe.c
+++ cctools-7.1.2/dttools/src/memfdexe.c
@@ -14,6 +14,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 int memfdexe (const char *name, const char *extradir)
 {
 	int fd;
Index: cctools-7.1.2/dttools/src/path_disk_size_info.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/path_disk_size_info.c
+++ cctools-7.1.2/dttools/src/path_disk_size_info.c
@@ -18,6 +18,10 @@ See the file COPYING for details.
 #include "stringtools.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 struct DIR_with_name {
 	DIR *dir;
 	char *name;
Index: cctools-7.1.2/dttools/src/clean_dir.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/clean_dir.c
+++ cctools-7.1.2/dttools/src/clean_dir.c
@@ -15,6 +15,10 @@ See the file COPYING for details.
 #include <stdio.h>
 #include <unistd.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 int clean_dir(const char *dirname, const char *delete_pattern)
 {
 	char subdir[PATH_MAX];
Index: cctools-7.1.2/dttools/src/compat-at.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/compat-at.c
+++ cctools-7.1.2/dttools/src/compat-at.c
@@ -22,6 +22,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 static int getfullpath (int dirfd, const char *path, char fullpath[PATH_MAX])
 {
 	char dirpath[PATH_MAX] = ".";
Index: cctools-7.1.2/dttools/src/copy_stream.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/copy_stream.c
+++ cctools-7.1.2/dttools/src/copy_stream.c
@@ -23,6 +23,10 @@ See the file COPYING for details.
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define COPY_BUFFER_SIZE (1<<16)
 
 int64_t copy_fd_to_stream(int fd, FILE *output)
Index: cctools-7.1.2/dttools/src/copy_tree.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/copy_tree.c
+++ cctools-7.1.2/dttools/src/copy_tree.c
@@ -22,6 +22,10 @@
 #include "path.h"
 #include "xxmalloc.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 static mode_t default_dirmode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
 
 int copy_dir_real(const char *source, const char *target);
Index: cctools-7.1.2/dttools/src/debug.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/debug.c
+++ cctools-7.1.2/dttools/src/debug.c
@@ -23,6 +23,10 @@ See the file COPYING for details.
 
 #include <stdio.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 extern void debug_stderr_write (int64_t flags, const char *str);
 extern void debug_stdout_write (int64_t flags, const char *str);
 
Index: cctools-7.1.2/dttools/src/debug_file.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/debug_file.c
+++ cctools-7.1.2/dttools/src/debug_file.c
@@ -21,6 +21,10 @@ See the file COPYING for details.
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 static int file_fd = -1;
 static struct stat file_stat;
 static char file_path[PATH_MAX];
Index: cctools-7.1.2/dttools/src/file_cache.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/file_cache.c
+++ cctools-7.1.2/dttools/src/file_cache.c
@@ -24,6 +24,10 @@ See the file COPYING for details.
 #include <signal.h>
 #include <time.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 /* Cygwin does not have 64-bit I/O, while Darwin has it by default. */
 
 #ifdef CCTOOLS_OPSYS_DARWIN
Index: cctools-7.1.2/dttools/src/jx_database.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/jx_database.c
+++ cctools-7.1.2/dttools/src/jx_database.c
@@ -22,6 +22,10 @@ See the file COPYING for details.
 #include <sys/types.h>
 #include <stdarg.h>
 
+#ifndef PATH_MAX // Hurd
+#define PATH_MAX 1024
+#endif
+
 struct jx_database {
 	struct hash_table *table;
 	const char *logdir;
Index: cctools-7.1.2/dttools/src/mkdir_recursive.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/mkdir_recursive.c
+++ cctools-7.1.2/dttools/src/mkdir_recursive.c
@@ -20,6 +20,10 @@ See the file COPYING for details.
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 int mkdirat_recursive (int fd, const char *path, mode_t mode)
 {
 	int rc;
Index: cctools-7.1.2/dttools/src/path.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/path.c
+++ cctools-7.1.2/dttools/src/path.c
@@ -24,6 +24,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 void path_absolute (const char *src, char *dest, int exist)
 {
 	struct stat buf;
Index: cctools-7.1.2/dttools/src/rmonitor_poll.c
===================================================================
--- cctools-7.1.2.orig/dttools/src/rmonitor_poll.c
+++ cctools-7.1.2/dttools/src/rmonitor_poll.c
@@ -26,6 +26,10 @@ See the file COPYING for details.
 #include "path_disk_size_info.h"
 #include "load_average.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 /***
  * Helper functions
 ***/
Index: cctools-7.1.2/dttools/test/TR_path_dirname.sh
===================================================================
--- cctools-7.1.2.orig/dttools/test/TR_path_dirname.sh
+++ cctools-7.1.2/dttools/test/TR_path_dirname.sh
@@ -12,6 +12,10 @@ prepare()
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 void test (const char *in, const char *expected)
 {
 	char out[PATH_MAX];
Index: cctools-7.1.2/parrot/src/irods_reli.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/irods_reli.cc
+++ cctools-7.1.2/parrot/src/irods_reli.cc
@@ -38,6 +38,10 @@ extern "C" {
 #include "stringtools.h"
 }
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #include <string>
 
 extern int pfs_irods_debug_level;
Index: cctools-7.1.2/parrot/src/parrot_package_create.c
===================================================================
--- cctools-7.1.2.orig/parrot/src/parrot_package_create.c
+++ cctools-7.1.2/parrot/src/parrot_package_create.c
@@ -17,6 +17,9 @@
 #include <time.h>
 #include <limits.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
 
 #include "copy_stream.h"
 #include "debug.h"
Index: cctools-7.1.2/parrot/src/pfs_channel.c
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_channel.c
+++ cctools-7.1.2/parrot/src/pfs_channel.c
@@ -22,6 +22,10 @@ See the file COPYING for details.
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 struct entry {
 	char *name;
 	pfs_size_t start;
Index: cctools-7.1.2/parrot/src/pfs_dispatch64.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_dispatch64.cc
+++ cctools-7.1.2/parrot/src/pfs_dispatch64.cc
@@ -68,6 +68,10 @@ extern "C" {
 #include <string.h>
 #include <time.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef EFD_CLOEXEC
 #	define EFD_CLOEXEC 02000000
 #endif
Index: cctools-7.1.2/parrot/src/pfs_dispatch.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_dispatch.cc
+++ cctools-7.1.2/parrot/src/pfs_dispatch.cc
@@ -59,6 +59,10 @@ extern "C" {
 #include <string.h>
 #include <time.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef EFD_CLOEXEC
 #	define EFD_CLOEXEC 02000000
 #endif
Index: cctools-7.1.2/parrot/src/pfs_main.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_main.cc
+++ cctools-7.1.2/parrot/src/pfs_main.cc
@@ -75,6 +75,10 @@ extern "C" {
 
 #include <vector>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #define SIG_ISSTOP(s) (s == SIGTTIN || s == SIGTTOU || s == SIGSTOP || s == SIGTSTP)
 
 FILE *namelist_file;
Index: cctools-7.1.2/parrot/src/pfs_process.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_process.cc
+++ cctools-7.1.2/parrot/src/pfs_process.cc
@@ -31,6 +31,10 @@ extern "C" {
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 pfs_pid_mode_t pfs_pid_mode = PFS_PID_MODE_NORMAL;
 
 int emulated_pid = 12345;
Index: cctools-7.1.2/parrot/src/pfs_table.cc
===================================================================
--- cctools-7.1.2.orig/parrot/src/pfs_table.cc
+++ cctools-7.1.2/parrot/src/pfs_table.cc
@@ -63,6 +63,10 @@ extern "C" {
 #include <stdlib.h>
 #include <string.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifndef O_CLOEXEC
 #	define O_CLOEXEC 02000000
 #endif
