Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Jun 2000 14:46:06 +0100
From:      "Koster, K.J." <K.J.Koster@kpn.com>
To:        'Cliff Rowley' <cliff@olive.co.uk>
Cc:        'FreeBSD Java mailing list' <freebsd-java@freebsd.org>
Subject:   RE: Exec patch?
Message-ID:  <59063B5B4D98D311BC0D0001FA7E4522026D7609@l04.research.kpn.com>

next in thread | raw e-mail | index | archive | help
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01BFD086.BACC5894
Content-Type: text/plain;
	charset="iso-8859-1"

This one?

    Kees Jan

==============================================
 Everyone is responsible for his own actions,
 and (people tend to forget this) the effect
 they have on others.



------_=_NextPart_000_01BFD086.BACC5894
Content-Type: application/octet-stream;
	name="wait.diff"
Content-Disposition: attachment;
	filename="wait.diff"

Index: src/freebsd/native/java/lang/UNIXProcess_md.c
===================================================================
RCS file: /data/java/JDK2/javasrc/src/freebsd/native/java/lang/UNIXProcess_md.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- src/freebsd/native/java/lang/UNIXProcess_md.c	1999/10/11 18:46:30	1.2
+++ src/freebsd/native/java/lang/UNIXProcess_md.c	2000/05/31 15:46:04	1.3
@@ -166,8 +166,9 @@
 JNIEXPORT void JNICALL
 Java_java_lang_UNIXProcess_run(JNIEnv *env, jobject process)
 {
-#ifdef __FreeBSD__	/*** XXX ***/
-    char info[256];
+#ifdef __FreeBSD__
+    pid_t pid;
+    int   status;
 #else
     siginfo_t info;
 #endif
@@ -188,14 +189,14 @@
 
 	/* block this reaper thread until the child process exits */
 #ifdef __FreeBSD__
-/* waitpid() is a wrapper, that does the "right thing" already */
-        if (waitid(P_ALL, 0, &info, WEXITED) != 0) {
-            continue;
-        }
+	/* waitpid() is a wrapper, that does the "right thing" already */
+        pid = waitid(P_ALL, 0, &status, WEXITED);
 #else
         if (waitid(P_ALL, 0, &info, WEXITED) != 0 || info.si_pid == 0) {
             continue;
         }
+        pid = info.si_pid;
+        status = info.si_status;
 #endif
 
 	(*env)->MonitorEnter(env, fork_wait_mon);
@@ -205,13 +206,8 @@
 				   "java/lang/UNIXProcess",
 				   "deadChild",
 				   "(II)V",
-#ifdef __FreeBSD__ /*** XXX ***/
-				   0, 
-				   0
-#else
-                                   info.si_pid,
-				   info.si_status
-#endif
+                                   pid,
+				   status
 	);
 	if ((*env)->ExceptionOccurred(env)) {
 	    return;
Index: src/freebsd/hpi/green_threads/src/synch.c
===================================================================
RCS file: /data/java/JDK2/javasrc/src/freebsd/hpi/green_threads/src/synch.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- src/freebsd/hpi/green_threads/src/synch.c	1999/11/03 03:54:58	1.4
+++ src/freebsd/hpi/green_threads/src/synch.c	2000/05/31 15:41:06	1.5
@@ -170,7 +170,7 @@
 
 #ifdef __FreeBSD__
 pid_t fork1(void);
-int waitid(int, int, void *, int);
+pid_t waitid(int, int, int *, int);
 #endif
 
 /* For java.lang.Process */
@@ -179,17 +179,16 @@
 extern int _waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
 int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
 #else
-int waitid(int idtype, int id, void *infop, int options)
+pid_t waitid(int idtype, int id, int *status, int options)
 #endif
 {
     sys_mon_t *mon = asyncMon(SYS_ASYNC_MON_CHILD);
 #ifdef __FreeBSD__
-    int status;
     pid_t pid;
 
     sysMonitorEnter(sysThreadSelf(), mon);
     do {
-	pid = waitpid(-1, &status, WNOHANG);
+	pid = waitpid(-1, status, WNOHANG);
 	if ((int)pid > 0 && !WIFSTOPPED(status))
 	    break;
         sysMonitorWait(sysThreadSelf(), mon, SYS_TIMEOUT_INFINITY);
@@ -202,7 +201,11 @@
     }
 #endif
     sysMonitorExit(sysThreadSelf(), mon);
+#ifdef __FreeBSD__
+    return pid;
+#else
     return 0;
+#endif
 }
 
 #ifndef __FreeBSD__

------_=_NextPart_000_01BFD086.BACC5894--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59063B5B4D98D311BC0D0001FA7E4522026D7609>