@@ -624,7 +624,7 @@ index 0000000..b6cdfae
624624+ m4_include([../acinclude.m4])
625625diff --git a/libgloss/libsysbase/build_argv.c b/libgloss/libsysbase/build_argv.c
626626new file mode 100644
627- index 0000000..79d2006
627+ index 0000000..3ca95d5
628628--- /dev/null
629629+++ b/libgloss/libsysbase/build_argv.c
630630@@ -0,0 +1,31 @@
@@ -646,13 +646,13 @@ index 0000000..79d2006
646646+ char** argv = (char**)(((int)data + len + sizeof(char **)) & ~(sizeof(char **)-1));
647647+ char* end = data + len - 1;
648648+ int argCount = 0;
649- +
649+ +
650650+ do {
651651+ argv[argCount++] = data; // Add next arg to argv list
652652+ while (*(data) && data < end) data++; // Move to next NULL delimiter
653653+ data++; // Move to one after the NULL delimiter
654654+ } while (data < end);
655- +
655+ +
656656+ *end = '\0'; // Force NULL terminator for last arg
657657+
658658+ argstruct->argv = argv;
@@ -661,7 +661,7 @@ index 0000000..79d2006
661661+ }
662662diff --git a/libgloss/libsysbase/chdir.c b/libgloss/libsysbase/chdir.c
663663new file mode 100644
664- index 0000000..2a0fa03
664+ index 0000000..90d2dc5
665665--- /dev/null
666666+++ b/libgloss/libsysbase/chdir.c
667667@@ -0,0 +1,201 @@
@@ -716,7 +716,7 @@ index 0000000..2a0fa03
716716+ }
717717+
718718+ /* Grab the next directory name from extra */
719- + extraEnd = strchr (extra, DIRECTORY_SEPARATOR_CHAR);
719+ + extraEnd = strchr (extra, DIRECTORY_SEPARATOR_CHAR);
720720+ if (extraEnd == NULL) {
721721+ extraEnd = strrchr (extra, '\0');
722722+ } else {
@@ -728,12 +728,12 @@ index 0000000..2a0fa03
728728+ break;
729729+ }
730730+
731- + if ((strncmp (extra, DIRECTORY_THIS, sizeof(DIRECTORY_THIS) - 1) == 0)
731+ + if ((strncmp (extra, DIRECTORY_THIS, sizeof(DIRECTORY_THIS) - 1) == 0)
732732+ && ((extra[sizeof(DIRECTORY_THIS)-1] == DIRECTORY_SEPARATOR_CHAR)
733733+ ||(extra[sizeof(DIRECTORY_THIS)-1] == '\0')))
734734+ {
735735+ /* Don't copy anything */
736- + } else if ((strncmp (extra, DIRECTORY_PARENT, sizeof(DIRECTORY_PARENT) - 1) == 0)
736+ + } else if ((strncmp (extra, DIRECTORY_PARENT, sizeof(DIRECTORY_PARENT) - 1) == 0)
737737+ && ((extra[sizeof(DIRECTORY_PARENT)-1] == DIRECTORY_SEPARATOR_CHAR)
738738+ ||(extra[sizeof(DIRECTORY_PARENT)-1] == '\0')))
739739+ {
@@ -868,7 +868,7 @@ index 0000000..2a0fa03
868868+ }
869869diff --git a/libgloss/libsysbase/chmod.c b/libgloss/libsysbase/chmod.c
870870new file mode 100644
871- index 0000000..ce79a2c
871+ index 0000000..3668b58
872872--- /dev/null
873873+++ b/libgloss/libsysbase/chmod.c
874874@@ -0,0 +1,30 @@
@@ -886,7 +886,7 @@ index 0000000..ce79a2c
886886+
887887+ /* Get device from path name */
888888+ dev = FindDevice(path);
889- +
889+ +
890890+ if (dev < 0) {
891891+ r->_errno = ENODEV;
892892+ ret = -1;
@@ -904,7 +904,7 @@ index 0000000..ce79a2c
904904+
905905diff --git a/libgloss/libsysbase/close.c b/libgloss/libsysbase/close.c
906906new file mode 100644
907- index 0000000..d3563fb
907+ index 0000000..a251e5b
908908--- /dev/null
909909+++ b/libgloss/libsysbase/close.c
910910@@ -0,0 +1,49 @@
@@ -940,7 +940,7 @@ index 0000000..d3563fb
940940+ dev = handle->device;
941941+ handle->refcount--;
942942+ if (handle->refcount == 0 ) {
943- +
943+ +
944944+ if(devoptab_list[dev]->close_r) {
945945+ ptr->deviceData = devoptab_list[dev]->deviceData;
946946+ ret = devoptab_list[dev]->close_r(ptr,handle->fileStruct);
@@ -5154,7 +5154,7 @@ index 0000000..874eec1
51545154+
51555155diff --git a/libgloss/libsysbase/configure.in b/libgloss/libsysbase/configure.in
51565156new file mode 100644
5157- index 0000000..c127df0
5157+ index 0000000..f3b8380
51585158--- /dev/null
51595159+++ b/libgloss/libsysbase/configure.in
51605160@@ -0,0 +1,199 @@
@@ -5214,9 +5214,9 @@ index 0000000..c127df0
52145214+ d10v*)
52155215+ ;;
52165216+ h8300*-*-*)
5217- + ;;
5217+ + ;;
52185218+ h8500-*-*)
5219- + ;;
5219+ + ;;
52205220+ i[3456]86-*-sco*)
52215221+ ;;
52225222+ lm32-*-*)
@@ -5239,7 +5239,7 @@ index 0000000..c127df0
52395239+ v850*-*-*)
52405240+ ;;
52415241+ w65-*-*)
5242- + ;;
5242+ + ;;
52435243+ xstormy16-*-*)
52445244+ ;;
52455245+ z8k-*-*)
@@ -5734,7 +5734,7 @@ index 0000000..c6b8c92
57345734+ }
57355735diff --git a/libgloss/libsysbase/fork.c b/libgloss/libsysbase/fork.c
57365736new file mode 100644
5737- index 0000000..712b13e
5737+ index 0000000..3aa75a3
57385738--- /dev/null
57395739+++ b/libgloss/libsysbase/fork.c
57405740@@ -0,0 +1,25 @@
@@ -5753,7 +5753,7 @@ index 0000000..712b13e
57535753+ struct _reent * r) {
57545754+ //---------------------------------------------------------------------------------
57555755+ #else
5756- + //---------------------------------------------------------------------------------
5756+ + //---------------------------------------------------------------------------------
57575757+ int
57585758+ _DEFUN (_fork, (),
57595759+ _NOARGS) {
@@ -6470,7 +6470,7 @@ index 0000000..4565909
64706470+ char *fake_heap_start = (char*)0;
64716471diff --git a/libgloss/libsysbase/mkdir.c b/libgloss/libsysbase/mkdir.c
64726472new file mode 100644
6473- index 0000000..4175cf8
6473+ index 0000000..b4fcbd3
64746474--- /dev/null
64756475+++ b/libgloss/libsysbase/mkdir.c
64766476@@ -0,0 +1,19 @@
@@ -6490,7 +6490,7 @@ index 0000000..4175cf8
64906490+ } else {
64916491+ r->_errno = ENOSYS;
64926492+ }
6493- +
6493+ +
64946494+ return ret;
64956495+ }
64966496diff --git a/libgloss/libsysbase/open.c b/libgloss/libsysbase/open.c
@@ -6613,7 +6613,7 @@ index 0000000..7f3f7f2
66136613+
66146614diff --git a/libgloss/libsysbase/rename.c b/libgloss/libsysbase/rename.c
66156615new file mode 100644
6616- index 0000000..7520d1d
6616+ index 0000000..f8a0aa9
66176617--- /dev/null
66186618+++ b/libgloss/libsysbase/rename.c
66196619@@ -0,0 +1,41 @@
@@ -6655,7 +6655,7 @@ index 0000000..7520d1d
66556655+ } else {
66566656+ r->_errno = EXDEV;
66576657+ }
6658- +
6658+ +
66596659+ return ret;
66606660+ }
66616661diff --git a/libgloss/libsysbase/rmdir.c b/libgloss/libsysbase/rmdir.c
@@ -6774,7 +6774,7 @@ index 0000000..e474c47
67746774+
67756775diff --git a/libgloss/libsysbase/statvfs.c b/libgloss/libsysbase/statvfs.c
67766776new file mode 100644
6777- index 0000000..b3dec22
6777+ index 0000000..84e2213
67786778--- /dev/null
67796779+++ b/libgloss/libsysbase/statvfs.c
67806780@@ -0,0 +1,24 @@
@@ -6799,12 +6799,12 @@ index 0000000..b3dec22
67996799+ } else {
68006800+ r->_errno = ENOSYS;
68016801+ }
6802- +
6802+ +
68036803+ return ret;
68046804+ }
68056805diff --git a/libgloss/libsysbase/syscall_support.c b/libgloss/libsysbase/syscall_support.c
68066806new file mode 100644
6807- index 0000000..70d717a
6807+ index 0000000..939ec25
68086808--- /dev/null
68096809+++ b/libgloss/libsysbase/syscall_support.c
68106810@@ -0,0 +1,63 @@
@@ -6824,7 +6824,7 @@ index 0000000..70d717a
68246824+ NULL // gettod_r
68256825+ };
68266826+
6827- + int __libc_lock_init(int *lock,int recursive) {
6827+ + int __libc_lock_init(int *lock,int recursive) {
68286828+
68296829+ if ( __syscalls.lock_init ) {
68306830+ return __syscalls.lock_init(lock, recursive);
@@ -6856,7 +6856,7 @@ index 0000000..70d717a
68566856+ if ( __syscalls.lock_acquire) {
68576857+ return __syscalls.lock_acquire(lock);
68586858+ }
6859- +
6859+ +
68606860+ return 0;
68616861+ }
68626862+
@@ -6873,7 +6873,7 @@ index 0000000..70d717a
68736873+ }
68746874diff --git a/libgloss/libsysbase/times.c b/libgloss/libsysbase/times.c
68756875new file mode 100644
6876- index 0000000..67db6c7
6876+ index 0000000..45e9781
68776877--- /dev/null
68786878+++ b/libgloss/libsysbase/times.c
68796879@@ -0,0 +1,21 @@
@@ -6890,7 +6890,7 @@ index 0000000..67db6c7
68906890+ struct tms *ptms) {
68916891+ #else
68926892+ clock_t _DEFUN (_times, (buf),
6893- + struct tms *buf) {
6893+ + struct tms *buf) {
68946894+
68956895+ struct _reent *r = _REENT;
68966896+ #endif
@@ -7007,7 +7007,7 @@ index 0000000..9a61639
70077007+
70087008diff --git a/libgloss/libsysbase/wait.c b/libgloss/libsysbase/wait.c
70097009new file mode 100644
7010- index 0000000..322c847
7010+ index 0000000..f64bf13
70117011--- /dev/null
70127012+++ b/libgloss/libsysbase/wait.c
70137013@@ -0,0 +1,29 @@
@@ -7020,22 +7020,22 @@ index 0000000..322c847
70207020+ #include <_syslist.h>
70217021+ #include <errno.h>
70227022+
7023- + //---------------------------------------------------------------------------------
7023+ + //---------------------------------------------------------------------------------
70247024+ #ifdef REENTRANT_SYSCALLS_PROVIDED
7025- + //---------------------------------------------------------------------------------
7025+ + //---------------------------------------------------------------------------------
70267026+ int
70277027+ _DEFUN (_wait_r, (r, status),
70287028+ struct _reent *r _AND
70297029+ int *status) {
70307030+
70317031+ #else
7032- + //---------------------------------------------------------------------------------
7032+ + //---------------------------------------------------------------------------------
70337033+ int
70347034+ _DEFUN (_wait, (status),
70357035+ int *status) {
70367036+ struct _reent *r = _REENT;
70377037+ #endif
7038- + //---------------------------------------------------------------------------------
7038+ + //---------------------------------------------------------------------------------
70397039+ r->_errno = ENOSYS;
70407040+ return -1;
70417041+ }
0 commit comments