Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit d277191

Browse files
author
Lefteris Koutsofios
committed
change for gcc v10
change to ps.c to remote pid size check change to sfputr.c to disable use of memccpy change to cmdarg.c to adjust argument length calc. due to failures in tw
1 parent cc1f2bf commit d277191

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

src/cmd/INIT/make.probe

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ case `gcc -v 2>&1 | egrep gcc.version` in
4545
*version' '7*) probe_shared_nostart= ;;
4646
*version' '8*) probe_shared_nostart= ;;
4747
*version' '9*) probe_shared_nostart= ;;
48+
*version' '10*) probe_shared_nostart= ;;
4849
esac
4950
probe_shared_registry='"-update_registry $probe_shared_registry_file"'
5051
probe_shared_registry_file='registry.ld'

src/cmd/std/ps.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,10 @@ addpid(Pssent_t* pe, register char* s)
12231223
break;
12241224
errno = 0;
12251225
n = strtol(t, &e, 0);
1226-
if (errno || n <= 0 || n > PID_MAX || *e)
1226+
// deleting check for PID_MAX because on linux this relies on kernel instance
1227+
// and the system will reject bad pids any way
1228+
// if (errno || n <= 0 || n > PID_MAX || *e)
1229+
if (errno || n <= 0 || *e)
12271230
{
12281231
error(2, "%s: invalid pid", t);
12291232
continue;

src/lib/libast/misc/cmdarg.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ cmdopen_20120411(char** argv, int argmax, int size, const char* argpat, Cmddisc_
129129
n += sizeof(char**) + strlen(*p) + 1;
130130
if ((x = strtol(astconf("ARG_MAX", NiL, NiL), NiL, 0)) <= 0)
131131
x = ARG_MAX;
132+
133+
#ifdef __linux__
134+
// adjust for linux, perhaps page alignment is going on
135+
// causes problems to tw when selecting many files
136+
if (x > getpagesize () * 50)
137+
x -= getpagesize ();
138+
#endif
139+
132140
if (size <= 0 || size > x)
133141
size = x;
134142
sh = pathshell();

src/lib/libast/sfio/sfputr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ int rc; /* record separator. */
105105
break;
106106
}
107107

108-
#if _lib_memccpy && !__ia64 /* these guys may never get it right */
108+
//#if _lib_memccpy && !__ia64 /* these guys may never get it right */
109+
// using memccpy here causes crashes - assuming overlap between src and dst
110+
#if 0
109111
if((ps = (uchar*)memccpy(ps,s,'\0',p)) != NIL(uchar*))
110112
ps -= 1;
111113
else ps = f->next+p;

0 commit comments

Comments
 (0)