name buffer size.
(dll_crt0_1): Allocate new_argv0 with PATH_MAX size.
* exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20;
(error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path
name buffer size.
* external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated.
Fill out ep.progname_long.
* fhandler_process.cc (fhandler_process::fill_filebuf): Allocate
buffer for executable filename with PATH_MAX size.
* pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH.
* pinfo.h (class _pinfo): Set progname size to PATH_MAX.
* smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH
for path name buffer size.
* strace.cc (strace::vsprntf): Ditto.
* include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define.
(EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP.
(struct external_pinfo): Add progname_long member.
* include/sys/dirent.h: Correctly include limits.h instead of
sys/limits.h.
+2007-12-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for path
+ name buffer size.
+ (dll_crt0_1): Allocate new_argv0 with PATH_MAX size.
+ * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20;
+ (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path
+ name buffer size.
+ * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated.
+ Fill out ep.progname_long.
+ * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate
+ buffer for executable filename with PATH_MAX size.
+ * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH.
+ * pinfo.h (class _pinfo): Set progname size to PATH_MAX.
+ * smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH
+ for path name buffer size.
+ * strace.cc (strace::vsprntf): Ditto.
+ * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define.
+ (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP.
+ (struct external_pinfo): Add progname_long member.
+ * include/sys/dirent.h: Correctly include limits.h instead of
+ sys/limits.h.
+
2007-12-05 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tty.cc (fhandler_tty_slave::open): Use MAX_PATH instead of
static void
initial_env ()
{
- char buf[CYG_MAX_PATH];
+ char buf[PATH_MAX];
if (GetEnvironmentVariable ("CYGWIN_TESTING", buf, sizeof (buf) - 1))
_cygwin_testing = 1;
{
DWORD ms = atoi (buf);
buf[0] = '\0';
- len = GetModuleFileName (NULL, buf, CYG_MAX_PATH);
+ len = GetModuleFileName (NULL, buf, PATH_MAX);
console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf);
Sleep (ms);
if (!strace.active () && !dynamically_loaded)
}
if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1))
{
- char buf1[CYG_MAX_PATH];
- len = GetModuleFileName (NULL, buf1, CYG_MAX_PATH);
+ char buf1[PATH_MAX];
+ len = GetModuleFileName (NULL, buf1, PATH_MAX);
strlwr (buf1);
strlwr (buf);
char *p = strpbrk (buf, ":=");
win32 style. */
if ((strchr (__argv[0], ':')) || (strchr (__argv[0], '\\')))
{
- char *new_argv0 = (char *) malloc (CYG_MAX_PATH);
+ char *new_argv0 = (char *) malloc (PATH_MAX);
cygwin_conv_to_posix_path (__argv[0], new_argv0);
__argv[0] = (char *) realloc (new_argv0, strlen (new_argv0) + 1);
}
#define CALL_HANDLER_RETRY 20
-char debugger_command[2 * CYG_MAX_PATH + 20];
+char debugger_command[2 * PATH_MAX + 20];
extern "C" {
extern void sigdelayed ();
return;
}
- char pgm[CYG_MAX_PATH];
- if (!GetModuleFileName (NULL, pgm, CYG_MAX_PATH))
+ char pgm[PATH_MAX];
+ if (!GetModuleFileName (NULL, pgm, PATH_MAX))
strcpy (pgm, "cygwin1.dll");
for (char *p = strchr (pgm, '\\'); p; p = strchr (p, '\\'))
*p = '/';
ep.start_time = p->start_time;
ep.rusage_self = p->rusage_self;
ep.rusage_children = p->rusage_children;
- strcpy (ep.progname, p->progname);
+ ep.progname[0] = '\0';
+ strncat (ep.progname, p->progname, MAX_PATH - 1);
ep.strace_mask = 0;
ep.version = EXTERNAL_PINFO_VERSION;
ep.uid32 = p->uid;
ep.gid32 = p->gid;
+
+ strcpy (ep.progname_long, p->progname);
break;
}
}
case PROCESS_EXENAME:
case PROCESS_EXE:
{
- filebuf = (char *) crealloc_abort (filebuf, bufalloc = CYG_MAX_PATH);
+ filebuf = (char *) crealloc_abort (filebuf, bufalloc = PATH_MAX);
if (p->process_state & PID_EXITED)
strcpy (filebuf, "<defunct>");
else
#define EXTERNAL_PINFO_VERSION_16_BIT 0
#define EXTERNAL_PINFO_VERSION_32_BIT 1
-#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_BIT
+#define EXTERNAL_PINFO_VERSION_32_LP 2
+#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_LP
#ifndef _SYS_TYPES_H
typedef unsigned short __uid16_t;
/* Only available if version >= EXTERNAL_PINFO_VERSION_32_BIT */
__uid32_t uid32;
__gid32_t gid32;
+
+ /* Only available if version >= EXTERNAL_PINFO_VERSION_32_LP */
+ char progname_long[PATH_MAX];
};
#endif /*__CYGWIN__*/
#endif /*WINVER*/
#define _SYS_DIRENT_H
#include <sys/types.h>
-#include <sys/limits.h>
+#include <limits.h>
#define __DIRENT_VERSION 2
commune_process (void *arg)
{
siginfo_t& si = *((siginfo_t *) arg);
- char path[CYG_MAX_PATH];
+ char path[PATH_MAX];
DWORD nr;
HANDLE& tothem = si._si_commune._si_write_handle;
HANDLE process_sync =
case PICOM_CWD:
{
sigproc_printf ("processing PICOM_CWD");
- unsigned int n = strlen (cygheap->cwd.get (path, 1, 1,
- CYG_MAX_PATH)) + 1;
+ unsigned int n = strlen (cygheap->cwd.get (path, 1, 1, PATH_MAX)) + 1;
if (!WriteFile (tothem, &n, sizeof n, &nr, NULL))
sigproc_printf ("WriteFile sizeof cwd failed, %E");
else if (!WriteFile (tothem, path, n, &nr, NULL))
}
locked = true;
- char name_buf[CYG_MAX_PATH];
+ char name_buf[MAX_PATH];
request_sync = CreateSemaphore (&sec_none_nih, 0, LONG_MAX,
shared_name (name_buf, "commune", myself->pid));
if (!request_sync)
if (cfd < 0)
s = cstrdup ("");
else
- s = cfd->get_proc_fd_name ((char *) cmalloc_abort (HEAP_COMMUNE, CYG_MAX_PATH));
+ s = cfd->get_proc_fd_name ((char *) cmalloc_abort (HEAP_COMMUNE, PATH_MAX));
n = strlen (s) + 1;
}
return s;
}
else
{
- s = (char *) cmalloc_abort (HEAP_COMMUNE, CYG_MAX_PATH);
- cygheap->cwd.get (s, 1, 1, CYG_MAX_PATH);
+ s = (char *) cmalloc_abort (HEAP_COMMUNE, PATH_MAX);
+ cygheap->cwd.get (s, 1, 1, PATH_MAX);
n = strlen (s) + 1;
}
return s;
DWORD dwProcessId;
/* Used to spawn a child for fork(), among other things. */
- char progname[CYG_MAX_PATH];
+ char progname[PATH_MAX];
/* User information.
The information is derived from the GetUserName system call,
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
+#include <limits.h>
#define LLMASK (0xffffffffffffffffULL)
#define LMASK (0xffffffff)
extern "C" int
__small_vsprintf (char *dst, const char *fmt, va_list ap)
{
- char tmp[CYG_MAX_PATH + 1];
+ char tmp[PATH_MAX];
char *orig = dst;
const char *s;
PWCHAR w;
dst = rnargLL (dst, 16, 0, len, pad);
break;
case 'P':
- if (!GetModuleFileName (NULL, tmp, CYG_MAX_PATH))
+ if (!GetModuleFileName (NULL, tmp, PATH_MAX))
s = "cygwin program";
else
s = tmp;
pn = NULL;
char *p;
- char progname[CYG_MAX_PATH];
+ char progname[PATH_MAX];
if (!pn)
GetModuleFileName (NULL, pn = progname, sizeof (progname));
if (!pn)